def test_shared_404_decorator(self): """shared_404_decorator calls correct error handler""" response = self.client.get(reverse('raise-misago-404')) self.assertEqual(response.status_code, 404) response = self.client.get(reverse('raise-404')) self.assertContains(response, "Custom 404", status_code=404) response = mock_custom_404_error_page(self.misago_request) self.assertNotContains(response, "Custom 404", status_code=404) response = mock_custom_404_error_page(self.site_request) self.assertContains(response, "Custom 404", status_code=404)
def test_shared_404_decorator(self): """shared_404_decorator calls correct error handler""" response = self.client.get(reverse('raise-misago-404')) self.assertEqual(response.status_code, 404) response = self.client.get(reverse('raise-404')) self.assertContains(response, "Custom 404", status_code=404) response = mock_custom_404_error_page(self.misago_request, Http404()) self.assertNotContains(response, "Custom 404", status_code=404) response = mock_custom_404_error_page(self.site_request, Http404()) self.assertContains(response, "Custom 404", status_code=404)
def test_shared_404_decorator(self): """shared_404_decorator calls correct error handler""" response = self.client.get(reverse('raise_misago_404')) self.assertEqual(response.status_code, 404) response = self.client.get(reverse('raise_404')) self.assertEqual(response.status_code, 404) self.assertIn("Custom 404", response.content) response = mock_custom_404_error_page(self.misago_request) self.assertNotIn("Custom 404", response.content) response = mock_custom_404_error_page(self.site_request) self.assertIn("Custom 404", response.content)