summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
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
commitd15d5ec54c73e657370cc8d4d7e1c1e7e6f40af4 (patch)
tree24c9a3bc567b906549ac66a96e66b99e60d002d5 /archaeological_operations/tests.py
parent3221ede6e709fc680e1bebebcfc334cc46e889ca (diff)
downloadIshtar-d15d5ec54c73e657370cc8d4d7e1c1e7e6f40af4.tar.bz2
Ishtar-d15d5ec54c73e657370cc8d4d7e1c1e7e6f40af4.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.py35
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):