diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-03-18 19:48:55 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-06-17 13:21:27 +0200 |
commit | e2ec8a3bf016f1cc1e86a9ddd8cfc6e4eadbc35f (patch) | |
tree | 45e9ef5617a75ecdbe9f3dab0e6d8be095b69e79 /archaeological_operations/tests.py | |
parent | e50b4030deb722c3c7d2ba79a7b7d0545ccd24f8 (diff) | |
download | Ishtar-e2ec8a3bf016f1cc1e86a9ddd8cfc6e4eadbc35f.tar.bz2 Ishtar-e2ec8a3bf016f1cc1e86a9ddd8cfc6e4eadbc35f.zip |
Fix stats cache for integer values
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r-- | archaeological_operations/tests.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 7867116fb..b773977a8 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -514,7 +514,7 @@ class ImportOperationTest(ImportTest, TestCase): sorted([p.parcel_number for p in last_parcels])) self.assertEqual(sections, sorted([p.section for p in last_parcels])) - ope1 = models.Operation.objects.filter(code_patriarche='4200').all()[0] + ope1 = models.Operation.objects.get(code_patriarche='4200') towns_ope = ope1.towns.all() imported = [imp for acc, imp in impt.get_all_imported()] for p in last_parcels: @@ -527,7 +527,7 @@ class ImportOperationTest(ImportTest, TestCase): operation_id=ope1.pk).external_id, '4200-59350-YY55') # cached_label update - ope2 = models.Operation.objects.filter(code_patriarche='4201').all()[0] + ope2 = models.Operation.objects.get(code_patriarche='4201') self.assertIn('LILLE', ope2.cached_label.upper()) # delete associated parcel with the import deletion parcel_count = models.Parcel.objects.count() @@ -1434,6 +1434,7 @@ class OperationTest(TestCase, OperationInitTest): "color": u"Red"}, "frog_number": 32303} operation.save() + operation = models.Operation.objects.get(pk=operation.pk) for key in ('marmott',): self.assertIn(key, operation.search_vector) for key in ('32303', 'red', 'Red'): @@ -1793,6 +1794,7 @@ class OperationSearchTest(TestCase, OperationInitTest): self._test_search(c, search_year_q, '2042";"2020', 2, "Many integer") search_town_q = str(pgettext("key for text search", u"town")) + town = Town.objects.get(pk=town.pk) self._test_search(c, search_town_q, town.cached_label, 1, "String search with parenthesis and minus") |