From dc738a0c76f5a15d8a81c3436ca1c4532d82a62f Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Wed, 19 Jul 2017 00:01:09 +0500 Subject: [PATCH] Removed redundant lookup values in RasterFieldTest.test_all_gis_lookups_with_rasters. These values produce already tested lookups and prevent another one from being tested. --- tests/gis_tests/rasterapp/test_rasterfield.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/gis_tests/rasterapp/test_rasterfield.py b/tests/gis_tests/rasterapp/test_rasterfield.py index a82a683558..f77c9ae6e8 100644 --- a/tests/gis_tests/rasterapp/test_rasterfield.py +++ b/tests/gis_tests/rasterapp/test_rasterfield.py @@ -169,16 +169,27 @@ class RasterFieldTest(TransactionTestCase): # Set lookup values for all function based operators. combo_values = [ rast, (rast, 0), (rast, 0), (stx_pnt, 0), stx_pnt, - rast, rast, json.loads(JSON_RASTER) + rast, json.loads(JSON_RASTER) ] else: # Override band lookup for these, as it's not supported. combo_keys[2] = 'rastprojected__' + name # Set lookup values for all other operators. - combo_values = [rast, rast, rast, stx_pnt, stx_pnt, rast, rast, json.loads(JSON_RASTER)] + combo_values = [rast, None, rast, stx_pnt, stx_pnt, rast, json.loads(JSON_RASTER)] # Create query filter combinations. - combos = [{x[0]: x[1]} for x in zip(combo_keys, combo_values)] + self.assertEqual( + len(combo_keys), + len(combo_values), + 'Number of lookup names and values should be the same', + ) + combos = list(x for x in zip(combo_keys, combo_values) if x[1]) + self.assertEqual( + [(n, x) for n, x in enumerate(combos) if x in combos[:n]], + [], + 'There are repeated test lookups', + ) + combos = [{k: v} for k, v in combos] for combo in combos: # Apply this query filter.