From 83b9177dbe5ff9e155df433ac9481bc8959655c6 Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Mon, 30 Aug 2021 16:01:20 -0700 Subject: [PATCH] Add basic timeline page load test --- core/tests/tests_views.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/tests/tests_views.py b/core/tests/tests_views.py index 75089962..ca5f8e6a 100644 --- a/core/tests/tests_views.py +++ b/core/tests/tests_views.py @@ -150,6 +150,19 @@ class ViewsTestCase(TestCase): self.assertEqual(page.status_code, 200) 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): page = self.c.get('/tummy-time/') self.assertEqual(page.status_code, 200)