Files
python-tdd/src/apps/lyric/tests/unit/test_authentication.py

13 lines
408 B
Python
Raw Normal View History

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)