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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user