summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/models_finds.py6
-rw-r--r--archaeological_finds/models_treatments.py3
-rw-r--r--archaeological_finds/tests.py6
3 files changed, 9 insertions, 6 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 2faf97d1d..77fe44da5 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -41,11 +41,13 @@ from ishtar_common.alternative_configs import ALTERNATE_CONFIGS
from ishtar_common.model_managers import ExternalIdManager, UUIDModelManager
from ishtar_common.models import Document, GeneralType, \
HierarchicalType, BaseHistorizedItem, LightHistorizedItem, \
- HistoricalRecords, OwnPerms, Person, Basket, post_save_cache, \
- ValueGetter, get_current_profile, IshtarSiteProfile, PRIVATE_FIELDS, \
+ OwnPerms, Person, Basket, post_save_cache, \
+ ValueGetter, get_current_profile, IshtarSiteProfile, \
GeoItem, BulkUpdatedItem, QuickAction, \
MainItem, document_attached_changed, HistoryModel, DynamicRequest, \
SearchAltName, QRCodeItem, SearchVectorConfig, DocumentItem
+from ishtar_common.models_common import HistoricalRecords
+from ishtar_common.utils import PRIVATE_FIELDS
from archaeological_operations.models import AdministrativeAct, Operation, \
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index a7af1117e..073083af4 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -35,10 +35,11 @@ from archaeological_context_records.models import Dating
from archaeological_warehouse.models import Warehouse, Container
from ishtar_common.model_managers import ExternalIdManager
from ishtar_common.models import Document, GeneralType, \
- ImageModel, BaseHistorizedItem, OwnPerms, HistoricalRecords, Person, \
+ ImageModel, BaseHistorizedItem, OwnPerms, Person, \
Organization, ValueGetter, post_save_cache, ShortMenuItem, \
DashboardFormItem, document_attached_changed, \
HistoryModel, SearchAltName, SearchVectorConfig, DocumentItem
+from ishtar_common.models_common import HistoricalRecords
from ishtar_common.utils import cached_label_changed, get_current_year, \
update_data, m2m_historization_changed
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py
index 35471df00..f3d54ae49 100644
--- a/archaeological_finds/tests.py
+++ b/archaeological_finds/tests.py
@@ -1156,7 +1156,7 @@ class FindSearchTest(FindInit, TestCase, SearchText):
find.conservatory_state = cs2
find.save()
- search = {'conservatory_state': cs2.pk}
+ search = {'search_vector': f'conservatory="{cs2.name}"'}
# no result when no authentication
response = c.get(reverse('get-find'), search)
@@ -1171,14 +1171,14 @@ class FindSearchTest(FindInit, TestCase, SearchText):
self.assertEqual(json.loads(content)['recordsTotal'], 1)
# no result for the brother
- search = {'conservatory_state': cs3.pk}
+ search = {'search_vector': f'conservatory="{cs3.name}"'}
response = c.get(reverse('get-find'), search)
self.assertEqual(response.status_code, 200)
content = response.content.decode()
self.assertEqual(json.loads(content)['recordsTotal'], 0)
# one result for the father
- search = {'conservatory_state': cs1.pk}
+ search = {'search_vector': f'conservatory="{cs1.name}"'}
response = c.get(reverse('get-find'), search)
self.assertEqual(response.status_code, 200)
content = response.content.decode()