summaryrefslogtreecommitdiff
path: root/Lib/test/test_http_cookies.py
diff options
context:
space:
mode:
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"')