summaryrefslogtreecommitdiff
path: root/archaeological_finds/tests.py
diff options
context:
space:
mode:
authorCefin <kevon@tuta.io>2021-10-12 17:05:59 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-07-08 09:58:48 +0200
commit92d30eb4c841b98d827324e11b84105ca12ab4ae (patch)
tree65bedb1cfd5a844f5e5757bb6e7fce351b902346 /archaeological_finds/tests.py
parentb401a12a769ed96bd7209dba8b9286d4d95897e1 (diff)
downloadIshtar-92d30eb4c841b98d827324e11b84105ca12ab4ae.tar.bz2
Ishtar-92d30eb4c841b98d827324e11b84105ca12ab4ae.zip
finalize the test with one error
Diffstat (limited to 'archaeological_finds/tests.py')
-rw-r--r--archaeological_finds/tests.py29
1 files changed, 13 insertions, 16 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py
index 59ea1c199..48605b547 100644
--- a/archaeological_finds/tests.py
+++ b/archaeological_finds/tests.py
@@ -55,6 +55,8 @@ from ishtar_common.models import (
get_current_profile,
UserProfile,
Town,
+ Organization,
+ OrganizationType,
Area,
Document,
SpatialReferenceSystem,
@@ -1152,12 +1154,6 @@ class FindSearchTest(FindInit, TestCase, SearchText):
User.objects.create_superuser(self.username, "myemail@test.com", self.password)
self.client = Client()
-
- def loggedIn_Client():
- c = Client()
- return c.login(username=self.username, password=self.password)
-
-
def test_material_type_hierarchic_search(self):
find = self.finds[0]
c = Client()
@@ -1286,7 +1282,7 @@ class FindSearchTest(FindInit, TestCase, SearchText):
operation = self.operations[0]
operator = Organization.objects.create(
name="My Orga",
- organization_type=OrganizationType.objects.all[0]
+ organization_type=OrganizationType.objects.all()[0]
)
operation.operator = operator
operation.save()
@@ -1296,7 +1292,7 @@ class FindSearchTest(FindInit, TestCase, SearchText):
key = str(pgettext_lazy("key for text search", "operator"))
result = [
- ('{}="{}"'.format(key, "My Orga"), 2)
+ ('{}="{}"'.format(key, "My Orga"), 1)
]
self._test_search(c, result, context="Text operator search")
@@ -1317,8 +1313,8 @@ class FindSearchTest(FindInit, TestCase, SearchText):
def test_address_operation_search(self):
- operation = self.operation[0]
- operation.address = "Street somewhere \n 29478 NOWHERE"
+ operation = self.operations[0]
+ operation.address = "Street somewhere 29478 NOWHERE"
operation.save()
c = Client()
@@ -1326,26 +1322,27 @@ class FindSearchTest(FindInit, TestCase, SearchText):
key = str(pgettext_lazy("key for text search", "address"))
result = [
- ('{}="{}"'.format(key, "Street somewhere \n 29478 NOWHERE"), 1)
+ ('{}="{}"'.format(key, "Street somewhere 29478 NOWHERE"), 1)
]
- self._test_search(c, result, context="Text Operation Address Search")
+ self._test_search(c, result, context="Text address Search")
def test_person_in_charge_search(self):
- operation = self.get_default_operationmodify
+ operation = self.operations[0]
operation.in_charge = Person.objects.create(
- raw_name="HISNAME Michel"
+ name="HISNAME",
+ surname="Michel"
)
operation.save()
c = Client()
- c.login(username=self.username, self.password)
+ c.login(username=self.username, password=self.password)
key = str(pgettext_lazy("key for text search", "person-in-charge"))
result = [
('{}="{}"'.format(key, "HISNAME Michel"), 1)
]
- self._test_search(c, result, context= "Text Person In Charge Search")
+ self._test_search(c, result, context="Text Person In Charge Search")
def test_conservatory_state_hierarchic_search(self):