diff options
| 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 | 
| commit | 07182d8f114eb87e9e1ae958df6c46d7dbac3b56 (patch) | |
| tree | 90fdc3f3ffc46dc609eff3928873d323e940c0e2 /archaeological_finds/tests.py | |
| parent | 97c568b85ae2969cf30665e6ebcc1620721e1195 (diff) | |
| parent | f2e2d4f7c7172cc84c14613ea4049ae54e75d818 (diff) | |
| download | Ishtar-07182d8f114eb87e9e1ae958df6c46d7dbac3b56.tar.bz2 Ishtar-07182d8f114eb87e9e1ae958df6c46d7dbac3b56.zip  | |
Merge branch 'master' into develop
Diffstat (limited to 'archaeological_finds/tests.py')
| -rw-r--r-- | archaeological_finds/tests.py | 34 | 
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',  | 
