diff options
Diffstat (limited to 'archaeological_operations/tests.py')
| -rw-r--r-- | archaeological_operations/tests.py | 35 | 
1 files changed, 33 insertions, 2 deletions
| diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index e58868c1f..74ae5819a 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -4629,8 +4629,39 @@ class ApiTest(OperationInitTest, APITestCase):              mock_get.return_value.text = tpes.read()          response = self.client.post(url, params, follow=True) -        # create and update matches from an external source -        # delete old matches! +        result = {"created": "XXXXX"} +        msg_created = str(_(f"{result['created']} matches created")).replace( +            result["created"], "" +        ) +        self.assertIn(msg_created, response.content.decode()) +        # test incoherent search_model and types +        with open( +            "../archaeological_operations/tests/external_source_types_2.json", "r" +        ) as tpes: +            mock_get.return_value.text = tpes.read() +        response = self.client.post(url, params, follow=True) + +        content = response.content.decode() +        self.assertNotIn(msg_created, content)  # no new creation +        missing_search_models = "archaeological_operations.strangeoperation" +        msg = str( +            _( +                f"Theses search models have not been found: {missing_search_models}. Not the same Ishtar version?" +            ) +        ).replace(result["created"], "") +        self.assertIn(msg, content) +        missing_types = "ishtar_common.oddtype" +        msg = str( +            _( +                f"Theses types have not been found: {missing_types}. Not the same Ishtar version?" +            ) +        ) +        self.assertIn(msg, content) +        # delete old matches +        result = {"deleted": 2} +        msg = str(_(f"{result['deleted']} matches deleted")) +        self.assertIn(msg, response.content.decode()) +          pass      def test_query_transformation(self): | 
