summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-06-10 22:35:05 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2015-06-10 22:35:05 +0200
commit8f5e6d05d1bca7a02924b419ba70198e7d325af3 (patch)
tree911d7bbe74be8331b7a91e80b613bb26d70a0c83
parent6bd8a905c50a39e04b9d957f96c1d1aee1556c49 (diff)
downloadIshtar-8f5e6d05d1bca7a02924b419ba70198e7d325af3.tar.bz2
Ishtar-8f5e6d05d1bca7a02924b419ba70198e7d325af3.zip
Test on import that no operation with same OA code can be imported
-rw-r--r--archaeological_operations/tests.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index a8d8e6415..9111c9ffe 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -54,20 +54,6 @@ class ImportOperationTest(TestCase):
self.username, self.password, self.user = create_superuser()
self.ishtar_user = IshtarUser.objects.get(pk=self.user.pk)
- #def testImportDbfOperation(self):
- # """
- # Test operation import
- # """
- # call_command('import_operations', os.sep.join([os.getcwd(), '..',
- # 'archaeological_operations', 'tests', 'sample.dbf']))
-
- #def testImportCsvOperation(self):
- # """
- # Test operation import
- # """
- # call_command('import_operations', os.sep.join([os.getcwd(), '..',
- # 'archaeological_operations', 'tests', 'sample.csv']))
-
def testMCCImports(self):
# MCC opérations
first_ope_nb = models.Operation.objects.count()
@@ -111,6 +97,12 @@ class ImportOperationTest(TestCase):
self.assertTrue(last_ope.code_patriarche == 4000)
self.assertTrue(last_ope.operation_type.txt_idx == 'prog_excavation')
+ # a second importation will be not possible: no two same patriarche code
+ impt.importation()
+ new_current_ope_nb = models.Operation.objects.count()
+ self.assertTrue(last_ope ==
+ models.Operation.objects.order_by('-pk').all()[0])
+
def testParseParcels(self):
# the database needs to be initialised before importing
from archaeological_operations.import_from_csv import parse_parcels