From 652af1410e284da7db5662317351e795b911e472 Mon Sep 17 00:00:00 2001 From: Jason Friedland Date: Fri, 17 Mar 2017 04:00:38 +1100 Subject: [PATCH] Fix for test when dict ordering differs (#237) --- pynamodb/tests/test_attributes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pynamodb/tests/test_attributes.py b/pynamodb/tests/test_attributes.py index 3c6739f86..aa0778b7f 100644 --- a/pynamodb/tests/test_attributes.py +++ b/pynamodb/tests/test_attributes.py @@ -613,11 +613,11 @@ def test_raw_map_json_serialize(self): } } - serialized_raw = json.dumps(raw) - self.assertEqual(json.dumps(AttributeTestModel(map_attr=raw).map_attr.as_dict()), - serialized_raw) - self.assertEqual(json.dumps(AttributeTestModel(map_attr=MapAttribute(**raw)).map_attr.as_dict()), - serialized_raw) + serialized_raw = json.dumps(raw, sort_keys=True) + self.assertEqual(json.dumps(AttributeTestModel(map_attr=raw).map_attr.as_dict(), + sort_keys=True), serialized_raw) + self.assertEqual(json.dumps(AttributeTestModel(map_attr=MapAttribute(**raw)).map_attr.as_dict(), + sort_keys=True), serialized_raw) def test_typed_and_raw_map_json_serialize(self): class TypedMap(MapAttribute):