summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r--archaeological_operations/tests.py6
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")