diff --git a/apitools/base/py/extra_types_test.py b/apitools/base/py/extra_types_test.py index 457c606a..13cd4395 100644 --- a/apitools/base/py/extra_types_test.py +++ b/apitools/base/py/extra_types_test.py @@ -125,12 +125,12 @@ class DateMsg(messages.Message): datetime.date(1980, 10, 24), datetime.date(1981, 1, 19), ]) - json_msg = json.dumps({ - 'start_date': '1752-09-09', 'all_dates': [ - '1979-05-06', '1980-10-24', '1981-01-19', - ]}) - self.assertEqual(json_msg, encoding.MessageToJson(msg)) - self.assertEqual(msg, encoding.JsonToMessage(DateMsg, json_msg)) + msg_dict = { + 'start_date': '1752-09-09', + 'all_dates': ['1979-05-06', '1980-10-24', '1981-01-19'], + } + self.assertEqual(msg_dict, json.loads(encoding.MessageToJson(msg))) + self.assertEqual(msg, encoding.JsonToMessage(DateMsg, json.dumps(msg_dict))) def testInt64(self): # Testing roundtrip of type 'long'