diff options
Diffstat (limited to 'archaeological_operations/tests.py')
| -rw-r--r-- | archaeological_operations/tests.py | 36 | 
1 files changed, 28 insertions, 8 deletions
| diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index bdc98707b..ae012840f 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -4437,16 +4437,16 @@ class ApiTest(OperationInitTest, APITestCase):          self.create_operation(self.user, self.orgas[0])          self.create_operation(self.user, self.orgas[0])          self.create_operation(self.user, self.orgas[0]) -        self.operation_0 = self.operations[0] +        self.operation_0 = models.Operation.objects.get(pk=self.operations[0].pk)          self.operation_0.code_patriarche = "28123"          self.operation_0.save() -        self.operation_1 = self.operations[0] +        self.operation_1 = models.Operation.objects.get(pk=self.operations[1].pk)          self.operation_1.code_patriarche = "28124"          self.operation_1.save() -        self.operation_2 = self.operations[0] +        self.operation_2 = models.Operation.objects.get(pk=self.operations[2].pk)          self.operation_2.code_patriarche = "29123"          self.operation_2.save() -        self.operation_3 = self.operations[0] +        self.operation_3 = models.Operation.objects.get(pk=self.operations[3].pk)          self.operation_3.code_patriarche = "29124"          self.operation_3.save()          self.auth_token = "Token " + Token.objects.create(user=self.user).key @@ -4460,7 +4460,7 @@ class ApiTest(OperationInitTest, APITestCase):                  model="operation"              )) -    def test_permissions(self): +    def test_api_permissions(self):          url = reverse("api-search-operation")          response = self.client.get(url, format="json")          # nothing OK @@ -4499,8 +4499,7 @@ class ApiTest(OperationInitTest, APITestCase):          self.api_user.ip = "127.0.0.1"          self.api_user.save() -    def test_search(self): -        "?submited=1&search_vector=2000" +    def test_api_search(self):          self.create_api_search_model()          url = reverse("api-search-operation")          data = { @@ -4513,4 +4512,25 @@ class ApiTest(OperationInitTest, APITestCase):          )          self.assertEqual(response.status_code, 200)          j = json.loads(response.content.decode()) -        print(j) +        self.assertEqual(j['recordsTotal'], 2) +        # test default filter + +    def test_query_transformation(self): +        # change query terms from a source Ishtar to match distant Ishtar +        pass + +    def test_external_source_query(self): +        # send a query to an external source when activated +        # test permissions for this query +        # test timeout +        pass + +    def test_type_match_api(self): +        pass + +    def test_type_admin(self): +        pass + +    def test_distant_sheet_display(self): +        # test query limitation +        pass | 
