18 lines
569 B
Python
18 lines
569 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)
|
|
|
|
def test_returns_None_if_no_uuid(self):
|
|
result = PasswordlessAuthenticationBackend().authenticate(HttpRequest())
|
|
self.assertIsNone(result)
|
|
|