diff --git a/tests/csrf_tests/tests.py b/tests/csrf_tests/tests.py
index 5300b21..b9e8cb5 100644
a
|
b
|
class CsrfViewMiddlewareTest(TestCase):
|
284 | 284 | self.assertEqual(403, req2.status_code) |
285 | 285 | |
286 | 286 | @override_settings(ALLOWED_HOSTS=['www.example.com']) |
| 287 | def test_https_malformed_referer(self): |
| 288 | """ |
| 289 | Test that a POST HTTPS request with a bad referer is rejected |
| 290 | """ |
| 291 | req = self._get_POST_request_with_token() |
| 292 | req._is_secure_override = True |
| 293 | req.META['HTTP_HOST'] = 'www.example.com' |
| 294 | req.META['HTTP_REFERER'] = 'http://http://www.example.com/' |
| 295 | req2 = CsrfViewMiddleware().process_view(req, post_form_view, (), {}) |
| 296 | self.assertNotEqual(None, req2) |
| 297 | self.assertEqual(403, req2.status_code) |
| 298 | |
| 299 | @override_settings(ALLOWED_HOSTS=['www.example.com']) |
287 | 300 | def test_https_good_referer(self): |
288 | 301 | """ |
289 | 302 | Test that a POST HTTPS request with a good referer is accepted |