summaryrefslogtreecommitdiff
path: root/Lib/test/test_http_cookies.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2017-02-09 16:09:03 +0100
committerNick Coghlan <ncoghlan@gmail.com>2017-02-09 16:09:03 +0100
commit2a1d833d5da7fa7a01a2eef183b0a208ed019427 (patch)
tree8da3ebb695ae55c69d0a58691403fb13d96a9476 /Lib/test/test_http_cookies.py
parentc6180bb73c8c7c7f9d8ea9816487b710597b6fc1 (diff)
parentbbd3587a29510bd5a318e0a19fc8570c0cd3b622 (diff)
downloadcpython-2a1d833d5da7fa7a01a2eef183b0a208ed019427.tar.gz
Merge issue #26355 fix from 3.6
Diffstat (limited to 'Lib/test/test_http_cookies.py')
-rw-r--r--Lib/test/test_http_cookies.py22
1 files changed, 7 insertions, 15 deletions
diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py
index 2432e0bf53..ca21476da6 100644
--- a/Lib/test/test_http_cookies.py
+++ b/Lib/test/test_http_cookies.py
@@ -9,15 +9,6 @@ import warnings
class CookieTests(unittest.TestCase):
- def setUp(self):
- self._warnings_manager = check_warnings()
- self._warnings_manager.__enter__()
- warnings.filterwarnings("ignore", ".* class is insecure.*",
- DeprecationWarning)
-
- def tearDown(self):
- self._warnings_manager.__exit__(None, None, None)
-
def test_basic(self):
cases = [
{'data': 'chips=ahoy; vienna=finger',
@@ -256,6 +247,9 @@ class MorselTests(unittest.TestCase):
# Check output and js_output.
M['path'] = '/foo' # Try a reserved key as well
M.set(i, "%s_val" % i, "%s_coded_val" % i)
+ self.assertEqual(M.key, i)
+ self.assertEqual(M.value, "%s_val" % i)
+ self.assertEqual(M.coded_value, "%s_coded_val" % i)
self.assertEqual(
M.output(),
"Set-Cookie: %s=%s; Path=/foo" % (i, "%s_coded_val" % i))
@@ -272,16 +266,14 @@ class MorselTests(unittest.TestCase):
self.assertRaises(cookies.CookieError,
M.set, i, '%s_value' % i, '%s_value' % i)
- def test_deprecation(self):
+ def test_set_properties(self):
morsel = cookies.Morsel()
- with self.assertWarnsRegex(DeprecationWarning, r'\bkey\b'):
+ with self.assertRaises(AttributeError):
morsel.key = ''
- with self.assertWarnsRegex(DeprecationWarning, r'\bvalue\b'):
+ with self.assertRaises(AttributeError):
morsel.value = ''
- with self.assertWarnsRegex(DeprecationWarning, r'\bcoded_value\b'):
+ with self.assertRaises(AttributeError):
morsel.coded_value = ''
- with self.assertWarnsRegex(DeprecationWarning, r'\bLegalChars\b'):
- morsel.set('key', 'value', 'coded_value', LegalChars='.*')
def test_eq(self):
base_case = ('key', 'value', '"value"')