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