summaryrefslogtreecommitdiff
path: root/tests/test_config
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2019-09-30 15:38:27 -0500
committerGitHub <noreply@github.com>2019-09-30 15:38:27 -0500
commit502149ae3694bcb8eefb42974e84a5bf603aaebb (patch)
treeb786809fbd15e69b5ecfcc010f1e0ff83b764bc7 /tests/test_config
parentf63d45aa7561098f5588eb93b6c3cde126c5e711 (diff)
parent070642056a2863c5da20cbc28626f4e8e1c49cdb (diff)
downloadpyramid-502149ae3694bcb8eefb42974e84a5bf603aaebb.tar.gz
pyramid-502149ae3694bcb8eefb42974e84a5bf603aaebb.tar.bz2
pyramid-502149ae3694bcb8eefb42974e84a5bf603aaebb.zip
Merge pull request #3512 from luhn/csrf-allow-no-origin
Add allow_no_origin option to CSRF
Diffstat (limited to 'tests/test_config')
-rw-r--r--tests/test_config/test_security.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test_config/test_security.py b/tests/test_config/test_security.py
index 5ebd78f8d..6257960b8 100644
--- a/tests/test_config/test_security.py
+++ b/tests/test_config/test_security.py
@@ -126,6 +126,7 @@ class ConfiguratorSecurityMethodsTests(unittest.TestCase):
list(sorted(result.safe_methods)),
['GET', 'HEAD', 'OPTIONS', 'TRACE'],
)
+ self.assertFalse(result.allow_no_origin)
self.assertTrue(result.callback is None)
def test_changing_set_default_csrf_options(self):
@@ -141,6 +142,7 @@ class ConfiguratorSecurityMethodsTests(unittest.TestCase):
token='DUMMY',
header=None,
safe_methods=('PUT',),
+ allow_no_origin=True,
callback=callback,
)
result = config.registry.getUtility(IDefaultCSRFOptions)
@@ -148,4 +150,5 @@ 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.assertTrue(result.callback is callback)