summaryrefslogtreecommitdiff
path: root/tests/test_exceptions.py
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2024-01-28 22:57:17 -0700
committerGitHub <noreply@github.com>2024-01-28 22:57:17 -0700
commite77b72dc3a0890911514ad8aab8c8bf26c4591d0 (patch)
tree569b1b1d53415f7f8fc692c632926f08611cccf9 /tests/test_exceptions.py
parent8de7b1f2b5df9a9225c514b2cfc5e5e0919daac2 (diff)
parent3abbab66159286e98a32a53e9b3a6c4705c69679 (diff)
downloadpyramid-e77b72dc3a0890911514ad8aab8c8bf26c4591d0.tar.gz
pyramid-e77b72dc3a0890911514ad8aab8c8bf26c4591d0.tar.bz2
pyramid-e77b72dc3a0890911514ad8aab8c8bf26c4591d0.zip
Merge pull request #3742 from Pylons/fix-csrf-400-status
Fix csrf 400 status lines
Diffstat (limited to 'tests/test_exceptions.py')
-rw-r--r--tests/test_exceptions.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py
index e7a2871a5..d5f247c2a 100644
--- a/tests/test_exceptions.py
+++ b/tests/test_exceptions.py
@@ -16,12 +16,22 @@ class TestBWCompat(unittest.TestCase):
self.assertTrue(one is two)
+class TestBadCSRFOrigin(unittest.TestCase):
+ def test_response_equivalence(self):
+ from pyramid.exceptions import BadCSRFOrigin
+ from pyramid.httpexceptions import HTTPBadRequest
+
+ self.assertTrue(isinstance(BadCSRFOrigin(), HTTPBadRequest))
+ self.assertEqual(BadCSRFOrigin().status, HTTPBadRequest().status)
+
+
class TestBadCSRFToken(unittest.TestCase):
def test_response_equivalence(self):
from pyramid.exceptions import BadCSRFToken
from pyramid.httpexceptions import HTTPBadRequest
self.assertTrue(isinstance(BadCSRFToken(), HTTPBadRequest))
+ self.assertEqual(BadCSRFToken().status, HTTPBadRequest().status)
class TestNotFound(unittest.TestCase):