File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -300,27 +300,30 @@ class TestClearExpired(TestCase):
300
300
def setUp (self ):
301
301
self .
user = UserModel .
objects .
create_user (
"test_user" ,
"[email protected] " ,
"123456" )
302
302
# Insert two tokens on database.
303
+ app = Application .objects .create (
304
+ name = "test_app" ,
305
+ redirect_uris = "http://localhost http://example.com http://example.org" ,
306
+ user = self .user ,
307
+ client_type = Application .CLIENT_CONFIDENTIAL ,
308
+ authorization_grant_type = Application .GRANT_AUTHORIZATION_CODE ,
309
+ )
303
310
AccessToken .objects .create (
304
- id = 1 ,
305
311
token = "555" ,
306
312
expires = timezone .now (),
307
313
scope = 2 ,
308
- application_id = 3 ,
309
- user_id = 1 ,
314
+ application = app ,
315
+ user = self . user ,
310
316
created = timezone .now (),
311
317
updated = timezone .now (),
312
- source_refresh_token_id = "0" ,
313
318
)
314
319
AccessToken .objects .create (
315
- id = 2 ,
316
320
token = "666" ,
317
321
expires = timezone .now (),
318
322
scope = 2 ,
319
- application_id = 3 ,
320
- user_id = 1 ,
323
+ application = app ,
324
+ user = self . user ,
321
325
created = timezone .now (),
322
326
updated = timezone .now (),
323
- source_refresh_token_id = "1" ,
324
327
)
325
328
326
329
def test_clear_expired_tokens (self ):
You can’t perform that action at this time.
0 commit comments