List objects now container owner values, saved upon creation, linked to user fk; apps.dashboard.views updated accordingly; 36 UTs passing (2 new)

This commit is contained in:
Disco DeDisco
2026-02-08 22:33:15 -05:00
parent 6c0e9bb6ec
commit 94a161fe09
4 changed files with 41 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ from django.core.exceptions import ValidationError
from django.db.utils import IntegrityError
from django.test import TestCase
from ..models import Item, List
from apps.lyric.models import User
class ItemModelTest(TestCase):
def test_default_text(self):
@@ -59,3 +60,11 @@ class ListModelTest(TestCase):
list(list1.item_set.all()),
[item1, item2, item3],
)
def test_lists_can_have_owners(self):
user = User.objects.create(email="a@b.cde")
mylist = List.objects.create(owner=user)
self.assertIn(mylist, user.lists.all())
def test_list_owner_is_optional(self):
List.objects.create()