Add basic timeline page load test

This commit is contained in:
Christopher C. Wells 2021-08-30 16:01:20 -07:00 committed by Christopher Charbonneau Wells
parent bc1d4a707b
commit 83b9177dbe
1 changed files with 13 additions and 0 deletions

View File

@ -150,6 +150,19 @@ class ViewsTestCase(TestCase):
self.assertEqual(page.status_code, 200) self.assertEqual(page.status_code, 200)
self.assertEqual(page.context['timer_count'], 1) self.assertEqual(page.context['timer_count'], 1)
def test_timeline_views(self):
child = models.Child.objects.first()
response = self.c.get('/timeline/')
self.assertRedirects(response, '/children/{}/'.format(child.slug))
models.Child.objects.create(
first_name='Second',
last_name='Child',
birth_date='2000-01-01'
)
response = self.c.get('/timeline/')
self.assertEqual(response.status_code, 200)
def test_tummytime_views(self): def test_tummytime_views(self):
page = self.c.get('/tummy-time/') page = self.c.get('/tummy-time/')
self.assertEqual(page.status_code, 200) self.assertEqual(page.status_code, 200)