Coverage for starter/tests/test_index.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.4.3, created at 2024-03-05 00:53 +0000

1from http import HTTPStatus 

2 

3from django.test import TestCase 

4from django.test.utils import override_settings 

5 

6 

7class ExampleTestCase(TestCase): 

8 

9 def test_index_with_debug_false(self): 

10 response = self.client.get('') 

11 self.assertEquals(response.status_code, HTTPStatus.NOT_FOUND) 

12 

13 @override_settings(DEBUG=True) 

14 def test_index_with_debug_true(self): 

15 response = self.client.get('') 

16 self.assertEquals(response.status_code, HTTPStatus.OK) 

17 self.assertContains(response, 'The install worked successfully! Congratulations!') 

18 self.assertContains(response, 'You are seeing this page because') 

19 self.assertContains(response, 'DEBUG=True') 

20 self.assertContains(response, 'is in your settings file and you have not configured any URLs.')