def test_json_encoder_decoder(self):
        messages = [
            {
                'message': Message(constants.INFO, 'Test message'),
                'message_list': [Message(constants.INFO, 'message %s') \
                                 for x in range(5)] + [{'another-message': \
                                 Message(constants.ERROR, 'error')}],
            },
            Message(constants.INFO, 'message %s'),
        ]
        encoder = MessageEncoder(separators=(',', ':'))
        value = encoder.encode(messages)
        decoded_messages = json.loads(value, cls=MessageDecoder)
        self.assertEqual(messages, decoded_messages)
Tests that a complex nested data structure containing Message
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/messages/tests/cookie.py/CookieTest.test_json_encoder_decoder