diff options
| author | Étienne Loks <etienne.loks@proxience.com> | 2015-10-28 13:40:59 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@proxience.com> | 2015-10-28 13:40:59 +0100 | 
| commit | dc7cea501d109bee8cdd3d5e9a0e47e8540fed9b (patch) | |
| tree | 1ecad22e5f83a9a77a1dc40e3f9e0bc749acef83 /archaeological_operations/tests.py | |
| parent | fe6fe8aaec642995cd9db1000de6a0fd3998e6fe (diff) | |
| download | Ishtar-dc7cea501d109bee8cdd3d5e9a0e47e8540fed9b.tar.bz2 Ishtar-dc7cea501d109bee8cdd3d5e9a0e47e8540fed9b.zip  | |
Imports: update MCC tests - fix m2m creation when not valu is provided
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 eaf2f081b..e74f579ed 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -166,7 +166,7 @@ class ImportOperationTest(TestCase):          self.assertTrue(current_nb == (old_nb + 2))          # and well imported          last_parcels = models.Parcel.objects.order_by('-pk').all()[0:2] -        external_ids = sorted(['XXXX', 'YY55']) +        external_ids = sorted(['4200-59350-YY55', '4200-75101-XXXX'])          parcel_numbers = sorted(['42', '55'])          sections = sorted(['ZX', 'YY'])          self.assertEqual(external_ids, @@ -184,13 +184,15 @@ class ImportOperationTest(TestCase):          self.assertEqual(len(imported), len(last_parcels))          self.assertEqual(models.Parcel.objects.get(parcel_number='55',                                                     section='YY').external_id, -                         'YY55') +                         '4200-59350-YY55')          # delete associated parcel with the import deletion          parcel_count = models.Parcel.objects.count()          impt.delete()          self.assertEqual(parcel_count - 2, models.Parcel.objects.count())      def testParseParcels(self): +        if not self.test_operations: +            return          # the database needs to be initialised before importing          from archaeological_operations.import_from_csv import parse_parcels          # default_town = Town.objects.create(numero_insee="12345",  | 
