88from flask_appbuilder .const import (
99 API_SECURITY_PASSWORD_KEY ,
1010 API_SECURITY_PROVIDER_KEY ,
11+ API_SECURITY_REFRESH_KEY ,
1112 API_SECURITY_USERNAME_KEY ,
1213 API_SECURITY_VERSION ,
1314)
@@ -36,7 +37,7 @@ def auth_client_post(client, token, uri, json):
3637 )
3738
3839 @staticmethod
39- def _login (client , username , password ):
40+ def _login (client , username , password , refresh : bool = False ):
4041 """
4142 Login help method
4243 :param client: Flask test client
@@ -45,15 +46,13 @@ def _login(client, username, password):
4546 :return: Flask client response class
4647 """
4748 return client .post (
48- "api/{}/security/login" .format (API_SECURITY_VERSION ),
49- data = json .dumps (
50- {
51- API_SECURITY_USERNAME_KEY : username ,
52- API_SECURITY_PASSWORD_KEY : password ,
53- API_SECURITY_PROVIDER_KEY : "db" ,
54- }
55- ),
56- content_type = "application/json" ,
49+ f"api/{ API_SECURITY_VERSION } /security/login" ,
50+ json = {
51+ API_SECURITY_USERNAME_KEY : username ,
52+ API_SECURITY_PASSWORD_KEY : password ,
53+ API_SECURITY_PROVIDER_KEY : "db" ,
54+ API_SECURITY_REFRESH_KEY : refresh ,
55+ },
5756 )
5857
5958 def login (self , client , username , password ):
0 commit comments