1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
website-2020-spike/website/common/tests.py

23 lines
643 B
Python
Raw Normal View History

2020-04-13 10:50:59 +01:00
from django.test import SimpleTestCase
from django.urls import reverse
class BaseTestCase(SimpleTestCase):
pass
class HomepageViewTestCase(BaseTestCase):
def test_accessible(self):
response = self.client.get(reverse("homepage"))
self.assertEqual(response.status_code, 200)
def test_contains_view_name(self):
response = self.client.get(reverse("homepage"))
self.assertContains(response, '<body class="homepageview">')
2020-04-25 20:35:34 +01:00
class AboutViewTestCase(BaseTestCase):
def test_accessible(self):
response = self.client.get(reverse("about"))
self.assertEqual(response.status_code, 200)