reorganized and reclassified old 'unit tests' for ea. app into dirs for UTs & ITs; abandoning effort to refactor any test_views into UTs; all tests passing
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
0
src/apps/lyric/tests/integrated/__init__.py
Normal file
0
src/apps/lyric/tests/integrated/__init__.py
Normal file
@@ -2,17 +2,11 @@ import uuid
|
||||
from django.http import HttpRequest
|
||||
from django.test import TestCase
|
||||
|
||||
from ..authentication import PasswordlessAuthenticationBackend
|
||||
from ..models import Token, User
|
||||
from apps.lyric.authentication import PasswordlessAuthenticationBackend
|
||||
from apps.lyric.models import Token, User
|
||||
|
||||
|
||||
class AuthenticateTest(TestCase):
|
||||
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_token_uuid_not_found(self):
|
||||
uid = uuid.uuid4()
|
||||
result = PasswordlessAuthenticationBackend().authenticate(
|
||||
@@ -1,7 +1,9 @@
|
||||
import uuid
|
||||
from django.contrib import auth
|
||||
from django.test import TestCase
|
||||
from ..models import Token, User
|
||||
|
||||
from apps.lyric.models import Token, User
|
||||
|
||||
|
||||
class UserModelTest(TestCase):
|
||||
def test_model_is_configured_for_django_auth(self):
|
||||
@@ -1,7 +1,10 @@
|
||||
from django.contrib import auth
|
||||
from django.test import TestCase
|
||||
from unittest import mock
|
||||
from ..models import Token
|
||||
|
||||
from apps.lyric.models import Token
|
||||
|
||||
|
||||
|
||||
class SendLoginEmailViewTest(TestCase):
|
||||
def test_redirects_to_home_page(self):
|
||||
0
src/apps/lyric/tests/unit/__init__.py
Normal file
0
src/apps/lyric/tests/unit/__init__.py
Normal file
12
src/apps/lyric/tests/unit/test_authentication.py
Normal file
12
src/apps/lyric/tests/unit/test_authentication.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user