From ac6b80fed98c08b5c53b0786cf8b8c89a37ccc1b Mon Sep 17 00:00:00 2001 From: Danny Hermes Date: Fri, 8 Jan 2016 14:07:32 -0800 Subject: [PATCH] Using query order in test_projection_query. This way, the results are in the same order in both production and the emulator. --- system_tests/datastore.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/system_tests/datastore.py b/system_tests/datastore.py index 90552ac1a917..1aa8c9fa642a 100644 --- a/system_tests/datastore.py +++ b/system_tests/datastore.py @@ -269,6 +269,7 @@ def test_ordered_query(self): def test_projection_query(self): filtered_query = self._base_query() filtered_query.projection = ['name', 'family'] + filtered_query.order = ['name', 'family'] # NOTE: There are 9 responses because of Catelyn. She has both # Stark and Tully as her families, hence occurs twice in @@ -279,6 +280,9 @@ def test_projection_query(self): self.assertEqual(len(entities), expected_matches) arya_entity = entities[0] + catelyn_tully_entity = entities[3] + sansa_entity = entities[8] + arya_dict = dict(arya_entity) self.assertEqual(arya_dict, {'name': 'Arya', 'family': 'Stark'}) @@ -287,13 +291,6 @@ def test_projection_query(self): self.assertEqual(catelyn_stark_dict, {'name': 'Catelyn', 'family': 'Stark'}) - if EMULATOR_DATASET is None: - catelyn_tully_entity = entities[3] - sansa_entity = entities[8] - else: - catelyn_tully_entity = entities[8] - sansa_entity = entities[7] - catelyn_tully_dict = dict(catelyn_tully_entity) self.assertEqual(catelyn_tully_dict, {'name': 'Catelyn', 'family': 'Tully'})