Add views tests for recently added models

This commit is contained in:
Christopher C. Wells 2022-05-28 06:41:37 -07:00 committed by Christopher Charbonneau Wells
parent db5615fcb9
commit fa746c68ca
1 changed files with 36 additions and 0 deletions

View File

@ -29,6 +29,18 @@ class ViewsTestCase(TestCase):
cls.c.login(**cls.credentials)
def test_bmi_views(self):
page = self.c.get("/bmi/")
self.assertEqual(page.status_code, 200)
page = self.c.get("/bmi/add/")
self.assertEqual(page.status_code, 200)
entry = models.BMI.objects.first()
page = self.c.get("/bmi/{}/".format(entry.id))
self.assertEqual(page.status_code, 200)
page = self.c.get("/bmi/{}/delete/".format(entry.id))
self.assertEqual(page.status_code, 200)
def test_child_views(self):
page = self.c.get("/children/")
self.assertEqual(page.status_code, 200)
@ -73,6 +85,30 @@ class ViewsTestCase(TestCase):
page = self.c.get("/feedings/{}/delete/".format(entry.id))
self.assertEqual(page.status_code, 200)
def test_headcircumference_views(self):
page = self.c.get("/head-circumference/")
self.assertEqual(page.status_code, 200)
page = self.c.get("/head-circumference/add/")
self.assertEqual(page.status_code, 200)
entry = models.HeadCircumference.objects.first()
page = self.c.get("/head-circumference/{}/".format(entry.id))
self.assertEqual(page.status_code, 200)
page = self.c.get("/head-circumference/{}/delete/".format(entry.id))
self.assertEqual(page.status_code, 200)
def test_height_views(self):
page = self.c.get("/height/")
self.assertEqual(page.status_code, 200)
page = self.c.get("/height/add/")
self.assertEqual(page.status_code, 200)
entry = models.Height.objects.first()
page = self.c.get("/height/{}/".format(entry.id))
self.assertEqual(page.status_code, 200)
page = self.c.get("/height/{}/delete/".format(entry.id))
self.assertEqual(page.status_code, 200)
def test_note_views(self):
page = self.c.get("/notes/")
self.assertEqual(page.status_code, 200)