diff options
author | Claude Paroz <claude@2xlibre.net> | 2020-01-31 11:11:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-31 11:11:24 +0100 |
commit | e7d62e97eb40ab441778d1dff9885b5d892d0f80 (patch) | |
tree | f3b544a15fbea19cf1e9bb8fa9c95feea90a16f3 /tests/messages_tests | |
parent | a97111eabf39e50625d7a8acc6cd46f4c5dad0da (diff) | |
download | django-e7d62e97eb40ab441778d1dff9885b5d892d0f80.tar.gz |
Refs #22426 -- Removed pre-Django 1.5 messages compatibility code and test.
This reverts commit f286721f7fdc2202f77a5f4d650d9d0779b86811.
Diffstat (limited to 'tests/messages_tests')
-rw-r--r-- | tests/messages_tests/test_cookie.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/tests/messages_tests/test_cookie.py b/tests/messages_tests/test_cookie.py index 211d33f04c..48c928cb9c 100644 --- a/tests/messages_tests/test_cookie.py +++ b/tests/messages_tests/test_cookie.py @@ -153,24 +153,3 @@ class CookieTests(BaseTests, SimpleTestCase): storage = self.get_storage() self.assertIsInstance(encode_decode(mark_safe("<b>Hello Django!</b>")), SafeData) self.assertNotIsInstance(encode_decode("<b>Hello Django!</b>"), SafeData) - - def test_pre_1_5_message_format(self): - """ - Messages that were set in the cookie before the addition of is_safedata - are decoded correctly (#22426). - """ - # Encode the messages using the current encoder. - messages = [Message(constants.INFO, 'message %s') for x in range(5)] - encoder = MessageEncoder(separators=(',', ':')) - encoded_messages = encoder.encode(messages) - - # Remove the is_safedata flag from the messages in order to imitate - # the behavior of before 1.5 (monkey patching). - encoded_messages = json.loads(encoded_messages) - for obj in encoded_messages: - obj.pop(1) - encoded_messages = json.dumps(encoded_messages, separators=(',', ':')) - - # Decode the messages in the old format (without is_safedata) - decoded_messages = json.loads(encoded_messages, cls=MessageDecoder) - self.assertEqual(messages, decoded_messages) |