diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-10-18 17:44:54 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:20:59 +0100 |
commit | 1b769cc99c16e42dd125914905b393782997acba (patch) | |
tree | 24c9a3bc567b906549ac66a96e66b99e60d002d5 /archaeological_operations/tests.py | |
parent | 0a46933a1a2028e0b41997eb9e1c41783a7c5fbb (diff) | |
download | Ishtar-1b769cc99c16e42dd125914905b393782997acba.tar.bz2 Ishtar-1b769cc99c16e42dd125914905b393782997acba.zip |
Syndication - delete unused matches - display match result - add a field for associated type in match
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): |