diff options
-rw-r--r-- | CHANGES.md | 8 | ||||
-rw-r--r-- | archaeological_finds/tests.py | 34 | ||||
-rw-r--r-- | archaeological_finds/views.py | 7 | ||||
-rw-r--r-- | ishtar_common/models.py | 2 | ||||
-rw-r--r-- | ishtar_common/views.py | 2 | ||||
-rw-r--r-- | version.py | 2 |
6 files changed, 49 insertions, 6 deletions
diff --git a/CHANGES.md b/CHANGES.md index d936b7cb2..7619cc407 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,14 @@ Ishtar changelog ================ +v0.99.24 (2017-07-12) +--------------------- +### Features ### +- Find deletion tests + +### Bug fixes ### +- CSV Export: add documentation type to models to exports - fail silently if type is not available + v0.99.23 (2017-07-11) --------------------- ### Features ### diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index b6382b720..41e113245 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 @@ -92,7 +92,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 + @@ -149,6 +148,37 @@ class FindWizardCreationTest(WizardTest, FindInit, TestCase): self.find_number + 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', diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py index 680faf421..2e84757c9 100644 --- a/archaeological_finds/views.py +++ b/archaeological_finds/views.py @@ -181,10 +181,13 @@ find_deletion_condition_dict = { 'selecw-find_deletion': check_warehouse_module, } -find_deletion_wizard = FindDeletionWizard.as_view([ +find_deletion_steps = [ ('selec-find_deletion', FindFormSelection), ('selecw-find_deletion', FindFormSelectionWarehouseModule), - ('final-find_deletion', FindDeletionForm)], + ('final-find_deletion', FindDeletionForm)] + +find_deletion_wizard = FindDeletionWizard.as_view( + find_deletion_steps, condition_dict=find_deletion_condition_dict, label=_(u"Find deletion"), url_name='find_deletion',) diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 639e44af3..5c84447a4 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2220,6 +2220,8 @@ TARGET_MODELS = [ ('archaeological_context_records.models.Unit', _(u"Unit")), ('archaeological_context_records.models.ActivityType', _(u"Activity type")), + ('archaeological_context_records.models.DocumentationType', + _(u"Documentation type")), ('archaeological_finds.models.MaterialType', _(u"Material")), ('archaeological_finds.models.ConservatoryState', _(u"Conservatory state")), diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 0be382866..5786391cc 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -1153,7 +1153,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[], for idx, col_name in enumerate(table_cols): val = data[1:][idx + delta].encode( ENCODING, errors='replace') - if "|" in col_name[0]: + if col_name and "|" in col_name[0]: for delta_idx in range(len(col_name[0].split('|')) - 1): delta += 1 val += data[1:][idx + delta].encode( diff --git a/version.py b/version.py index e7ae337c7..96dee143e 100644 --- a/version.py +++ b/version.py @@ -1,4 +1,4 @@ -VERSION = (0, 99, 23) +VERSION = (0, 99, 24) def get_version(): |