summaryrefslogtreecommitdiff
path: root/archaeological_finds/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-07-12 00:05:13 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-07-12 00:05:13 +0200
commit2b2a7011abfbe5e59a64a4cabd7852408ff63181 (patch)
tree90fdc3f3ffc46dc609eff3928873d323e940c0e2 /archaeological_finds/tests.py
parent3e013d7f3b403de865f0ae612d272099dda3004c (diff)
parent7f88c7f77b615aa8f3de93589d4ce313be652e87 (diff)
downloadIshtar-2b2a7011abfbe5e59a64a4cabd7852408ff63181.tar.bz2
Ishtar-2b2a7011abfbe5e59a64a4cabd7852408ff63181.zip
Merge branch 'master' into develop
Diffstat (limited to 'archaeological_finds/tests.py')
-rw-r--r--archaeological_finds/tests.py34
1 files changed, 32 insertions, 2 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py
index 3aa0f6ea0..75f580633 100644
--- a/archaeological_finds/tests.py
+++ b/archaeological_finds/tests.py
@@ -26,7 +26,7 @@ from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from django.test.client import Client
from ishtar_common.models import ImporterType, IshtarUser, ImporterColumn,\
- FormaterType, ImportTarget
+ FormaterType, ImportTarget, IshtarSiteProfile
from ishtar_common.models import Person, get_current_profile
from archaeological_context_records.models import Period, Dating
@@ -95,7 +95,6 @@ class FindInit(ContextRecordInit):
class FindWizardCreationTest(WizardTest, FindInit, TestCase):
- # TODO: first to be run because of strange init things...
fixtures = [settings.ROOT_PATH +
'../fixtures/initial_data.json',
settings.ROOT_PATH +
@@ -154,6 +153,37 @@ class FindWizardCreationTest(WizardTest, FindInit, TestCase):
self.assertEqual(find.datings.count(), 1)
+class FindWizardDeletionWithWarehouseModTest(WizardTest, FindInit, TestCase):
+ fixtures = FindWizardCreationTest.fixtures
+ url_name = 'find_deletion'
+ wizard_name = 'find_deletion_wizard'
+ steps = views.find_deletion_steps
+ form_datas = [
+ FormData(
+ 'Find deletion',
+ form_datas={
+ 'selecw': {},
+ },
+ ignored=['selec-find_deletion']
+ )
+ ]
+
+ def pre_wizard(self):
+ profile, created = IshtarSiteProfile.objects.get_or_create(
+ slug='default', active=True)
+ profile.warehouse = True
+ profile.save()
+
+ find, bf = self.get_default_find(force=True)
+ self.form_datas[0].set('selecw', 'pk', find.pk)
+ self.find_number = models.Find.objects.count()
+ super(FindWizardDeletionWithWarehouseModTest, self).pre_wizard()
+
+ def post_wizard(self):
+ self.assertEqual(models.Find.objects.count(),
+ self.find_number - 1)
+
+
class TreatmentWizardCreationTest(WizardTest, FindInit, TestCase):
fixtures = [settings.ROOT_PATH +
'../fixtures/initial_data.json',