From 0db36c5e136bba3048bebbe1fda8f8c55afdec36 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 18 Jun 2015 04:15:51 +0200 Subject: Import: really prevent from associating not created object to an import --- archaeological_operations/tests.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'archaeological_operations') diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 484e2b259..bbe92b3c8 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -162,8 +162,11 @@ class ImportOperationTest(TestCase): sorted([p.section for p in last_parcels])) last_ope = models.Operation.objects.order_by('-pk').all()[0] towns_ope = last_ope.towns.all() + imported = [imp for acc, imp in impt.get_all_imported()] for p in last_parcels: self.assertTrue(p.town in towns_ope) + self.assertTrue(p in imported) + self.assertEqual(len(imported), len(last_parcels)) self.assertEqual(models.Parcel.objects.get(parcel_number='55', section='YY').external_id, 'YY55') -- cgit v1.2.3