summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCefin <kevon@tuta.io>2021-10-12 17:05:59 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-11-16 17:04:41 +0100
commit8886c1790ee8bf98dd2b1a9bff7fa2d75ccd9c5a (patch)
tree2cd932631b5ab599704feec3ab25623fc1404dd0
parent9fffaf762e1206301881ed35048651ac8ba19c74 (diff)
downloadIshtar-8886c1790ee8bf98dd2b1a9bff7fa2d75ccd9c5a.tar.bz2
Ishtar-8886c1790ee8bf98dd2b1a9bff7fa2d75ccd9c5a.zip
finalize the test with one error
-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):