'Messages that were set in the cookie before the addition of is_safedata
are decoded correctly (#22426).'

def test_pre_1_5_message_format(self):

    messages = [Message(constants.INFO, 'message    %s') for x in range(5)]
    encoder = MessageEncoder(separators=(',', ':'))
    encoded_messages = encoder.encode(messages)
    encoded_messages = json.loads(encoded_messages)
    for obj in encoded_messages:
        obj.pop(1)
    encoded_messages = json.dumps(encoded_messages, separators=(',', ':'))
    decoded_messages = json.loads(encoded_messages, cls=MessageDecoder)
    self.assertEqual(messages, decoded_messages)
