summaryrefslogtreecommitdiff
path: root/tests/test_config
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2019-09-30 21:27:20 -0500
committerMichael Merickel <michael@merickel.org>2019-10-17 22:49:49 -0500
commit8b7b7cbf9058312f0bf6b044cfa388f807eff739 (patch)
tree1b7de5c2b62928aea23372adb2b95b42aa5eab0c /tests/test_config
parent2153b4b878d77aa0cb5b79805dd185d133c26451 (diff)
downloadpyramid-8b7b7cbf9058312f0bf6b044cfa388f807eff739.tar.gz
pyramid-8b7b7cbf9058312f0bf6b044cfa388f807eff739.tar.bz2
pyramid-8b7b7cbf9058312f0bf6b044cfa388f807eff739.zip
support Origin: null in csrf_trusted_origins and check_origin=False
Diffstat (limited to 'tests/test_config')
-rw-r--r--tests/test_config/test_security.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test_config/test_security.py b/tests/test_config/test_security.py
index 0ae199239..9a9ea9f7e 100644
--- a/tests/test_config/test_security.py
+++ b/tests/test_config/test_security.py
@@ -158,6 +158,7 @@ class ConfiguratorSecurityMethodsTests(unittest.TestCase):
list(sorted(result.safe_methods)),
['GET', 'HEAD', 'OPTIONS', 'TRACE'],
)
+ self.assertTrue(result.check_origin)
self.assertFalse(result.allow_no_origin)
self.assertTrue(result.callback is None)
@@ -174,7 +175,8 @@ class ConfiguratorSecurityMethodsTests(unittest.TestCase):
token='DUMMY',
header=None,
safe_methods=('PUT',),
- allow_no_origin=True,
+ check_origin=False,
+ allow_no_origin=False,
callback=callback,
)
result = config.registry.getUtility(IDefaultCSRFOptions)
@@ -182,5 +184,6 @@ class ConfiguratorSecurityMethodsTests(unittest.TestCase):
self.assertEqual(result.token, 'DUMMY')
self.assertEqual(result.header, None)
self.assertEqual(list(sorted(result.safe_methods)), ['PUT'])
- self.assertTrue(result.allow_no_origin)
+ self.assertFalse(result.check_origin)
+ self.assertFalse(result.allow_no_origin)
self.assertTrue(result.callback is callback)