2026-02-18 19:07:02 -05:00
|
|
|
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)
|
2026-02-18 20:18:56 -05:00
|
|
|
|
|
|
|
|
def test_returns_None_if_no_uuid(self):
|
|
|
|
|
result = PasswordlessAuthenticationBackend().authenticate(HttpRequest())
|
|
|
|
|
self.assertIsNone(result)
|
|
|
|
|
|