From c0c7c9e4d9a15ce26eb495d2f2dbb9ef62b11f3b Mon Sep 17 00:00:00 2001 From: devketanpro Date: Tue, 31 Oct 2023 18:39:27 +0530 Subject: [PATCH] add test --- apps/publish/publish_service_tests.py | 31 ++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/apps/publish/publish_service_tests.py b/apps/publish/publish_service_tests.py index 6241d6b944..e87d3b8aee 100644 --- a/apps/publish/publish_service_tests.py +++ b/apps/publish/publish_service_tests.py @@ -44,7 +44,29 @@ class PublishServiceTests(TestCase): "sequence_num_settings": {"max": 10, "min": 1}, "critical_errors": {"9004": True}, "destinations": [{"name": "NITF", "delivery_type": "ftp", "format": "nitf", "config": {}}], - } + }, + { + "_id": "2", + "name": "Test2", + "subscriber_type": SUBSCRIBER_TYPES.WIRE, + "media_type": "media", + "is_active": True, + "sequence_num_settings": {"max": 10, "min": 1}, + "critical_errors": {"9004": True}, + "destinations": [ + { + "name": "HTTP PUSH", + "delivery_type": "http_push", + "format": "nitf", + "config": { + "resource_url": "http://localhost:5050/push", + "assets_url": "http://localhost:5050/push_binary", + "packaged": "true", + "secret_token": "newsroom", + }, + } + ], + }, ] def setUp(self): @@ -114,3 +136,10 @@ def test_highlight_query(self): self.assertEqual( ["body_html", "body_footer", "headline", "slugline", "abstract"], list(source["highlight"]["fields"].keys()) ) + + def test_subscribers_secret_token(self): + subscriber_service = superdesk.get_resource_service("subscribers") + data = list(subscriber_service.get(req=None, lookup={})) + item = data[1] + self.assertEqual("Test2", item["name"]) + self.assertNotIn("secret_token", item["destinations"][0]["config"])