new name @property in List model, replete w. proper testing in tests.test_models

This commit is contained in:
Disco DeDisco
2026-02-08 22:50:03 -05:00
parent 94a161fe09
commit 4e1feddb45
2 changed files with 10 additions and 0 deletions

View File

@@ -68,3 +68,9 @@ class ListModelTest(TestCase):
def test_list_owner_is_optional(self):
List.objects.create()
def test_list_name_is_first_item_text(self):
list_ = List.objects.create()
Item.objects.create(list=list_, text="first item")
Item.objects.create(list=list_, text="second item")
self.assertEqual(list_.name, "first item")