From c16b81a618e713bf27a4c0204355c18e32300a97 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 10 Jun 2022 17:04:36 +0100 Subject: [PATCH] Test homepage is accessible --- website/home/tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 website/home/tests.py diff --git a/website/home/tests.py b/website/home/tests.py new file mode 100644 index 0000000..b53ddaf --- /dev/null +++ b/website/home/tests.py @@ -0,0 +1,11 @@ +from django.test import TestCase +from .models import HomePage + +class HomePageTestCase(TestCase): + @classmethod + def setUpTestData(cls): + cls.page = HomePage.objects.get() + + def test_accessible(self): + response = self.client.get(self.page.url) + self.assertEqual(response.status_code, 200)