File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ class Meta:
4949 abstract = True
5050
5151 def __str__ (self ) -> str :
52- return '%s : %s' % ( self .digest , self .user )
52+ return f' { self .digest } : { self .user } '
5353
5454
5555class AuthToken (AbstractAuthToken ):
Original file line number Diff line number Diff line change 2323
2424def get_basic_auth_header (username , password ):
2525 return 'Basic %s' % base64 .b64encode (
26- ('%s:%s' % ( username , password ) ).encode ('ascii' )).decode ()
26+ (f' { username } : { password } ' ).encode ('ascii' )).decode ()
2727
2828
2929auto_refresh_knox = knox_settings .defaults .copy ()
@@ -198,7 +198,7 @@ def test_update_token_key(self):
198198 instance , token = AuthToken .objects .create (self .user )
199199 rf = APIRequestFactory ()
200200 request = rf .get ('/' )
201- request .META = {'HTTP_AUTHORIZATION' : 'Token {}' . format ( token ) }
201+ request .META = {'HTTP_AUTHORIZATION' : f 'Token { token } ' }
202202 (self .user , auth_token ) = TokenAuthentication ().authenticate (request )
203203 self .assertEqual (
204204 token [:CONSTANTS .TOKEN_KEY_LENGTH ],
You can’t perform that action at this time.
0 commit comments