mirror of https://github.com/snachodog/mybuddy.git
Add test for child without last name
This commit is contained in:
parent
c91b556739
commit
00d04f1464
|
@ -39,6 +39,16 @@ class ChildTestCase(TestCase):
|
||||||
self.assertEqual(child.name(), "First Last")
|
self.assertEqual(child.name(), "First Last")
|
||||||
self.assertEqual(child.name(reverse=True), "Last, First")
|
self.assertEqual(child.name(reverse=True), "Last, First")
|
||||||
|
|
||||||
|
def test_child_create_without_last_name(self):
|
||||||
|
child = models.Child.objects.create(
|
||||||
|
first_name="Nolastname", birth_date=timezone.localdate()
|
||||||
|
)
|
||||||
|
self.assertEqual(child, models.Child.objects.get(first_name="Nolastname"))
|
||||||
|
self.assertEqual(child.slug, "nolastname")
|
||||||
|
self.assertEqual(str(child), "Nolastname")
|
||||||
|
self.assertEqual(child.name(), "Nolastname")
|
||||||
|
self.assertEqual(child.name(reverse=True), "Nolastname")
|
||||||
|
|
||||||
def test_child_count(self):
|
def test_child_count(self):
|
||||||
self.assertEqual(models.Child.count(), 0)
|
self.assertEqual(models.Child.count(), 0)
|
||||||
models.Child.objects.create(
|
models.Child.objects.create(
|
||||||
|
|
Loading…
Reference in New Issue