diff options
| author | Ryan Hiebert <ryan@ryanhiebert.com> | 2024-05-18 04:30:12 -0500 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-05-21 11:03:39 +0200 |
| commit | c201014e85f321173a018914e148734f29f1e28b (patch) | |
| tree | a78433d1eb5720de4d322417c037134386872fc0 /tests/view_tests | |
| parent | 0b33a3abc2ca7d68a24f6d0772bc2b9fa603744e (diff) | |
Removed hardcoded docs version in csrf template.
Diffstat (limited to 'tests/view_tests')
| -rw-r--r-- | tests/view_tests/tests/test_csrf.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/view_tests/tests/test_csrf.py b/tests/view_tests/tests/test_csrf.py index af16ffd740..2d530cc586 100644 --- a/tests/view_tests/tests/test_csrf.py +++ b/tests/view_tests/tests/test_csrf.py @@ -132,3 +132,15 @@ class CsrfViewTests(SimpleTestCase): with mock.patch.object(Path, "open") as m: csrf_failure(mock.MagicMock(), mock.Mock()) m.assert_called_once_with(encoding="utf-8") + + @override_settings(DEBUG=True) + @mock.patch("django.views.csrf.get_docs_version", return_value="4.2") + def test_doc_links(self, mocked_get_complete_version): + response = self.client.post("/") + self.assertContains(response, "Forbidden", status_code=403) + self.assertNotContains( + response, "https://docs.djangoproject.com/en/dev/", status_code=403 + ) + self.assertContains( + response, "https://docs.djangoproject.com/en/4.2/", status_code=403 + ) |
