diff options
| author | Theron Luhn <theron@luhn.com> | 2019-09-19 18:32:41 -0700 |
|---|---|---|
| committer | Theron Luhn <theron@luhn.com> | 2019-09-19 18:32:41 -0700 |
| commit | 6dd21309e4d9b21162b8db3e015533be10db0601 (patch) | |
| tree | b032a3aeeeed79fcb6ad1b273bc214147dd0884c /tests/test_config | |
| parent | 3af1883bcd617d74eb8c9b134b5ac830f8cdd2a9 (diff) | |
| download | pyramid-6dd21309e4d9b21162b8db3e015533be10db0601.tar.gz pyramid-6dd21309e4d9b21162b8db3e015533be10db0601.tar.bz2 pyramid-6dd21309e4d9b21162b8db3e015533be10db0601.zip | |
Add allow_no_origin option to CSRF.
Diffstat (limited to 'tests/test_config')
| -rw-r--r-- | tests/test_config/test_security.py | 3 |
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) |
