diff options
| author | Chris McDonough <chrism@plope.com> | 2011-09-29 19:24:55 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-09-29 19:24:55 -0400 |
| commit | 8b676ba9e1654d575be5695f481dba10ceceed9a (patch) | |
| tree | 7f86a9807b6e91272f59b7c0ccc11bbd45e5419f /tests/test_request.py | |
| parent | 44ca44f2f390b6c917211a439c314b19fa0ab695 (diff) | |
| download | webob-8b676ba9e1654d575be5695f481dba10ceceed9a.tar.gz | |
* ``request.cookies`` property now returns an immutable dictionary;
attempting to modify it will result in a TypeError.
Diffstat (limited to 'tests/test_request.py')
| -rw-r--r-- | tests/test_request.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_request.py b/tests/test_request.py index 2303f3f..e455729 100644 --- a/tests/test_request.py +++ b/tests/test_request.py @@ -755,6 +755,11 @@ class BaseRequestTests(unittest.TestCase): req = BaseRequest({}) self.assertEqual(req.cookies, {}) + def test_cookies_is_immutable(self): + req = BaseRequest({}) + cookies = req.cookies + self.assertRaises(TypeError, cookies.__setitem__, 'a', 1) + def test_cookies_w_webob_parsed_cookies_matching_source(self): environ = { 'HTTP_COOKIE': 'a=b', |
