summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-08-16 12:38:41 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-08-16 12:38:41 +0200
commit162405c1d1b3ca112ae71b3cc93d3689b9e89822 (patch)
treefa0614969e604e65396fabf9a48cbd7c97a410e8 /archaeological_operations/tests.py
parente653e1ae9a75ae0d634315e99c7600fa3d897fbe (diff)
downloadIshtar-162405c1d1b3ca112ae71b3cc93d3689b9e89822.tar.bz2
Ishtar-162405c1d1b3ca112ae71b3cc93d3689b9e89822.zip
Manage ope prefixes with the profile
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r--archaeological_operations/tests.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index f50e58eaa..a3cd5fd8d 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -43,7 +43,7 @@ from ishtar_common.models import OrganizationType, Organization, ItemKey, \
Town, ImporterColumn, Person, Author, SourceType, AuthorType, \
DocumentTemplate, PersonType, TargetKeyGroup, JsonDataField, \
JsonDataSection, ImportTarget, FormaterType, CustomForm, ExcludedField, \
- UserProfile, ProfileType, Area, CustomFormJsonField
+ UserProfile, ProfileType, Area, CustomFormJsonField, get_current_profile
from archaeological_files.models import File, FileType
from archaeological_context_records.models import Unit, ContextRecord
@@ -1103,8 +1103,10 @@ class OperationTest(TestCase, OperationInitTest):
# verify the relevance of the update
cr = ContextRecord.objects.get(pk=cr.pk)
ope_id, parcel_sec, parcel_nb, cr_label = cr.cached_label.split(' | ')
- self.assertEqual(ope_id, '{}2011-1'.format(
- settings.ISHTAR_DEF_OPE_PREFIX))
+ profile = get_current_profile()
+
+ self.assertEqual(
+ ope_id, '{}2011-1'.format(profile.default_operation_prefix))
base_find = BaseFind.objects.get(pk=base_find.pk)
op_code, idx = base_find.cache_short_id.split(' | ')
@@ -1126,7 +1128,8 @@ class OperationTest(TestCase, OperationInitTest):
operation.save()
cr = ContextRecord.objects.get(pk=cr.pk)
ope_id, parcel_sec, parcel_nb, cr_label = cr.cached_label.split(' | ')
- self.assertEqual(ope_id, '{}666'.format(settings.ISHTAR_OPE_PREFIX))
+
+ self.assertEqual(ope_id, '{}666'.format(profile.operation_prefix))
base_find = BaseFind.objects.get(pk=base_find.pk)
op_code, idx = base_find.cache_short_id.split(' | ')