summaryrefslogtreecommitdiff
path: root/tests/test_csrf.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_csrf.py')
-rw-r--r--tests/test_csrf.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_csrf.py b/tests/test_csrf.py
index d1b569c32..f93a1afde 100644
--- a/tests/test_csrf.py
+++ b/tests/test_csrf.py
@@ -363,6 +363,12 @@ class Test_check_csrf_origin(unittest.TestCase):
request.registry.settings = {}
self.assertTrue(self._callFUT(request))
+ def test_success_with_allow_no_origin(self):
+ request = testing.DummyRequest()
+ request.scheme = "https"
+ request.referrer = None
+ self.assertTrue(self._callFUT(request, allow_no_origin=True))
+
def test_fails_with_wrong_host(self):
from pyramid.exceptions import BadCSRFOrigin