diff --git a/server/belga/publish/belga_newsml_1_2.py b/server/belga/publish/belga_newsml_1_2.py index 5431d2e3..cbd4f02a 100644 --- a/server/belga/publish/belga_newsml_1_2.py +++ b/server/belga/publish/belga_newsml_1_2.py @@ -967,7 +967,7 @@ def _format_newslines(self, newscomponent_2_level, item): SubElement(newslines, "CreditLine").text = subject.get("name") break else: - if item.get("source"): + if item.get("source") and item.get("ingest_provider"): SubElement(newslines, "CreditLine").text = ( item["source"] .replace( diff --git a/server/tests/publish/belga_newsml_1_2_picture_tests.py b/server/tests/publish/belga_newsml_1_2_picture_tests.py index 253a3ebd..7bce8195 100644 --- a/server/tests/publish/belga_newsml_1_2_picture_tests.py +++ b/server/tests/publish/belga_newsml_1_2_picture_tests.py @@ -301,7 +301,7 @@ def test_picture(self): ) # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> CreditLine self.assertEqual( - newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "Superdesk" + newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "BELGA" ) # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> HeadLine self.assertEqual( diff --git a/server/tests/publish/belga_newsml_1_2_text_tests.py b/server/tests/publish/belga_newsml_1_2_text_tests.py index f5f863f8..85c2ceb1 100644 --- a/server/tests/publish/belga_newsml_1_2_text_tests.py +++ b/server/tests/publish/belga_newsml_1_2_text_tests.py @@ -71,7 +71,7 @@ class BelgaNewsML12FormatterTextTest(TestCase): "original_creator": "5d385f31fe985ec67a0ca583", "unique_id": 43, "unique_name": "#43", - "state": "ingested", + "state": "in_progress", "source": "Belga", "priority": 6, "urgency": 4, @@ -1579,7 +1579,7 @@ def test_uploaded_picture_in_editor(self): # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> CreditLine self.assertEqual( - newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "Superdesk" + newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "BELGA" ) # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> HeadLine self.assertEqual( @@ -1705,7 +1705,7 @@ def test_belga_picture_in_editor(self): # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> CreditLine self.assertEqual( - newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "ZUMAPRESS" + newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "BELGA" ) # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> HeadLine self.assertEqual( @@ -1808,7 +1808,7 @@ def test_uploaded_picture_related_images(self): # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> CreditLine self.assertEqual( - newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "Superdesk" + newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "BELGA" ) # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> HeadLine self.assertEqual( @@ -1972,7 +1972,7 @@ def test_belga_coverages(self): # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> CreditLine self.assertEqual( - newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "ITARTASS" + newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "BELGA" ) # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> HeadLine self.assertEqual( @@ -2029,7 +2029,7 @@ def test_belga_coverage_custom_field(self): # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> CreditLine self.assertEqual( - newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "AFP" + newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "BELGA" ) # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> HeadLine self.assertEqual( @@ -2083,7 +2083,7 @@ def test_audio_in_editor_and_related(self): # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> CreditLine self.assertEqual( - newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "Superdesk" + newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "BELGA" ) # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> HeadLine self.assertEqual( @@ -2134,7 +2134,7 @@ def test_video_in_editor_and_related(self): # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> CreditLine self.assertEqual( - newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "Superdesk" + newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "BELGA" ) # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> HeadLine self.assertEqual( @@ -2235,7 +2235,7 @@ def test_related_article_internal(self): # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> CreditLine self.assertEqual( - newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "Belga" + newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "BELGA" ) # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> HeadLine self.assertEqual( diff --git a/server/tests/publish/belga_newsml_1_2_video_tests.py b/server/tests/publish/belga_newsml_1_2_video_tests.py index 1326d940..88522be9 100644 --- a/server/tests/publish/belga_newsml_1_2_video_tests.py +++ b/server/tests/publish/belga_newsml_1_2_video_tests.py @@ -347,7 +347,7 @@ def test_video(self): ) # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> CreditLine self.assertEqual( - newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "Superdesk" + newscomponent_2_level.xpath("NewsLines/CreditLine")[0].text, "BELGA" ) # NewsML -> NewsItem -> NewsComponent -> NewsComponent -> NewsLines -> HeadLine self.assertEqual(