core: fix linting
This commit is contained in:
parent
13900bc603
commit
310b31a8b7
|
@ -1,10 +1,10 @@
|
|||
"""passbook user view tests"""
|
||||
from guardian.shortcuts import get_anonymous_user
|
||||
from django.test import TestCase
|
||||
from django.utils.timezone import now
|
||||
from guardian.shortcuts import get_anonymous_user
|
||||
|
||||
from passbook.core.tasks import clean_tokens
|
||||
from passbook.core.models import Token
|
||||
from passbook.core.tasks import clean_tokens
|
||||
|
||||
|
||||
class TestTasks(TestCase):
|
||||
|
@ -12,14 +12,7 @@ class TestTasks(TestCase):
|
|||
|
||||
def test_token_cleanup(self):
|
||||
"""Test Token cleanup task"""
|
||||
Token.objects.create(
|
||||
expires=now(),
|
||||
user=get_anonymous_user()
|
||||
)
|
||||
self.assertEqual(
|
||||
Token.objects.all().count(), 1
|
||||
)
|
||||
Token.objects.create(expires=now(), user=get_anonymous_user())
|
||||
self.assertEqual(Token.objects.all().count(), 1)
|
||||
clean_tokens()
|
||||
self.assertEqual(
|
||||
Token.objects.all().count(), 0
|
||||
)
|
||||
self.assertEqual(Token.objects.all().count(), 0)
|
||||
|
|
Reference in a new issue