website/website/home/tests.py

16 lines
356 B
Python
Raw Normal View History

2022-06-10 17:04:36 +01:00
from django.test import TestCase
2022-06-12 15:17:28 +01:00
2022-06-10 17:04:36 +01:00
from .models import HomePage
2022-06-12 15:17:28 +01:00
2022-06-10 17:04:36 +01:00
class HomePageTestCase(TestCase):
2022-06-12 15:17:28 +01:00
page: HomePage
2022-06-10 17:04:36 +01:00
@classmethod
2022-06-12 15:17:28 +01:00
def setUpTestData(cls) -> None:
2022-06-10 17:04:36 +01:00
cls.page = HomePage.objects.get()
2022-06-12 15:17:28 +01:00
def test_accessible(self) -> None:
response = self.client.get(self.page.url)
self.assertEqual(response.status_code, 200)