diff options
author | Cefin <kevon@tuta.io> | 2021-10-12 17:05:59 +0200 |
---|---|---|
committer | Cefin <kevon@tuta.io> | 2021-10-13 10:57:40 +0200 |
commit | 6f2564d8fef92994facf07b2161861832eeb00f2 (patch) | |
tree | cb522855b514c347623b228e3ecfb6a17c7a6e61 /archaeological_finds/tests.py | |
parent | 64e5204d91d136c398ba0177c13322025459e0f0 (diff) | |
download | Ishtar-6f2564d8fef92994facf07b2161861832eeb00f2.tar.bz2 Ishtar-6f2564d8fef92994facf07b2161861832eeb00f2.zip |
finalize the test with one error
Diffstat (limited to 'archaeological_finds/tests.py')
-rw-r--r-- | archaeological_finds/tests.py | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index 935c52c7e..9b8244760 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, @@ -1134,12 +1136,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() @@ -1268,7 +1264,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() @@ -1278,7 +1274,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") @@ -1299,8 +1295,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() @@ -1308,26 +1304,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): |