summaryrefslogtreecommitdiff
path: root/archaeological_context_records/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_context_records/tests.py')
-rw-r--r--archaeological_context_records/tests.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/archaeological_context_records/tests.py b/archaeological_context_records/tests.py
index cbb5e0775..32e97c730 100644
--- a/archaeological_context_records/tests.py
+++ b/archaeological_context_records/tests.py
@@ -38,7 +38,7 @@ from archaeological_operations import models as models_ope
from archaeological_context_records import models
from ishtar_common.tests import WizardTest, WizardTestFormData as FormData, \
- create_superuser, create_user, TestCase
+ create_superuser, create_user, TestCase, AutocompleteTestBase, AcItem
from archaeological_context_records import views
@@ -839,3 +839,22 @@ class ContextRecordWizardCreationTest(WizardTest, ContextRecordInit, TestCase):
# identical datings, only one should be finaly save
cr = models.ContextRecord.objects.order_by('-pk')[0]
self.assertEqual(cr.datings.count(), 1)
+
+
+class AutocompleteTest(AutocompleteTestBase, TestCase):
+ fixtures = CONTEXT_RECORD_FIXTURES
+ models = [
+ AcItem(models.ContextRecord, 'autocomplete-contextrecord',
+ prepare_func="create_cr"),
+ ]
+
+ def create_cr(self, base_name):
+ ope, __ = models_ope.Operation.objects.get_or_create(
+ common_name="Test",
+ operation_type=models_ope.OperationType.objects.all()[0]
+ )
+ item, __ = models.ContextRecord.objects.get_or_create(
+ operation=ope,
+ label=base_name
+ )
+ return item, None