13 lines
408 B
Python
13 lines
408 B
Python
|
|
from django.http import HttpRequest
|
||
|
|
from django.test import SimpleTestCase
|
||
|
|
|
||
|
|
from apps.lyric.authentication import PasswordlessAuthenticationBackend
|
||
|
|
|
||
|
|
|
||
|
|
class SimpleAuthenticateTest(SimpleTestCase):
|
||
|
|
def test_returns_None_if_token_is_invalid_uuid(self):
|
||
|
|
result = PasswordlessAuthenticationBackend().authenticate(
|
||
|
|
HttpRequest(), "no-such-token"
|
||
|
|
)
|
||
|
|
self.assertIsNone(result)
|