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

This commit is contained in:
Disco DeDisco
2026-02-18 19:07:02 -05:00
parent c41624152a
commit a06fce26ef
13 changed files with 57 additions and 28 deletions

View File

@@ -0,0 +1,25 @@
import uuid
from django.contrib import auth
from django.test import TestCase
from apps.lyric.models import Token, User
class UserModelTest(TestCase):
def test_model_is_configured_for_django_auth(self):
self.assertEqual(auth.get_user_model(), User)
def test_user_is_valid_with_email_only(self):
user = User(email="a@b.cde")
user.full_clean() # should not raise
def test_id_is_primary_key(self):
user = User(id="123")
self.assertEqual(user.pk, "123")
class TokenModelTest(TestCase):
def test_links_user_with_autogen_uid(self):
token1 = Token.objects.create(email="a@b.cde")
token2 = Token.objects.create(email="v@w.xyz")
self.assertNotEqual(token1.pk, token2.pk)
self.assertIsInstance(token1.pk, uuid.UUID)