Files
python-tdd/src/apps/lyric/tests/unit/test_authentication.py
2026-02-18 20:18:56 -05:00

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)