-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syndicate API including currently RSS and ATOM formatter API #1188
Open
rbi-aap
wants to merge
63
commits into
superdesk:lockhart
Choose a base branch
from
rbi-aap:lockhart
base: lockhart
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 23 commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
5b4e71c
update version for the https://sofab.atlassian.net/browse/SDAN-726
rbi-aap d2ebb0d
update for fix building error
rbi-aap beae01e
update for building error
rbi-aap d9f036c
update for review
rbi-aap c3217fe
update from review feedback regarding naming convention from audioIf …
rbi-aap b19a074
update for review
rbi-aap 6433e61
remove space
rbi-aap 41fcac4
remove space line
rbi-aap 72f4876
Merge branch 'superdesk:lockhart' into lockhart
rbi-aap 5f58d87
syndicate API. including RSS and ATOM formatter
rbi-aap 43eb8c0
update style
rbi-aap cf5bcfa
split the 125 long line
rbi-aap 391cf09
keep same name
rbi-aap a968773
update for review and feedback
rbi-aap 9fa50f7
update for line long issues
rbi-aap f341ed5
for line long
rbi-aap 165cc8a
for orderdict error in test
rbi-aap 73a0b14
for behave test
rbi-aap fcf0f01
update
rbi-aap 6a36641
add regular expression in route for avoid conflicts with old API
rbi-aap 87c3098
update for the review
rbi-aap c3be21b
update for review
rbi-aap b826fb4
update for review
rbi-aap 520fb03
for block-content SDAN-728 and SDAN-731
rbi-aap 31a2437
for sync
rbi-aap dca96c4
replace await with promise
rbi-aap e5e4d15
for review
rbi-aap bc4ca05
for style
rbi-aap 6d1803d
update after unit test for review
rbi-aap 5ae6bd9
update for flake8
rbi-aap 996dfe6
update for review
rbi-aap 5fad329
for unit test
rbi-aap 8bc3bc9
for test only
rbi-aap a46d813
temp turn off test_bookmarks test not relavant to content block
rbi-aap 7200041
test
rbi-aap 706d14d
test
rbi-aap 750035a
for mock get_user in test
rbi-aap 724c74c
for front end
rbi-aap d326f8d
ArticleBodyHTML.jsx -add XSS attach prevent and video player improvement
rbi-aap abe2ad0
update incorrect icon
rbi-aap 4ccdc0b
update for env
rbi-aap 68bd3d2
update
rbi-aap 67a48d6
for env update
rbi-aap 980c47e
for env change
rbi-aap b847be9
update env
rbi-aap 565b8de
update
rbi-aap ef16577
update
rbi-aap f2e546b
update
rbi-aap 141d3e9
update for old failed test
rbi-aap ae47ffc
update for a test
rbi-aap 5bcacde
update for check
rbi-aap 3ec72ba
change user type
rbi-aap 80a288a
update for feature test
rbi-aap 7204aee
block_media
rbi-aap 49c403f
update for unit_test block_media
rbi-aap aaa1e17
update a few features near to release
rbi-aap a1d2243
lint check for indent
rbi-aap 8d7a608
Enhanced video loading and poster management, updated Webpack and pac…
rbi-aap f1ee3c5
for update the ESLint for webpack and React
rbi-aap bb82ebe
for images.js to manage images in Webpack
rbi-aap 1019cb7
for review update
rbi-aap 61e88d5
remove memory monitoring function in live repo
rbi-aap 7dc8049
check the reason
rbi-aap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
Feature: News API Syndicate ATOM Search | ||
|
||
Background: Initial setup | ||
Given "companies" | ||
""" | ||
[{"name": "Test Company", "is_enabled" : true}] | ||
""" | ||
Given "news_api_tokens" | ||
""" | ||
[{"company" : "#companies._id#", "enabled" : true}] | ||
""" | ||
When we save API token | ||
|
||
Scenario: Test atom of syndicate request response restricted by product | ||
Given "items" | ||
""" | ||
[{"body_html": "Once upon a time there was a fish who could swim", "headline": "headline 1", | ||
"firstpublished": "#DATE-1#", "versioncreated": "#DATE#"}, | ||
{"body_html": "Once upon a time there was a aardvark that could not swim", "headline": "headline 2", | ||
"firstpublished": "#DATE-1#", "versioncreated": "#DATE#"}] | ||
""" | ||
Given "products" | ||
""" | ||
[{"name": "A fishy Product", | ||
"decsription": "a product for those interested in fish", | ||
"companies" : [ | ||
"#companies._id#" | ||
], | ||
"query": "fish", | ||
"product_type": "news_api" | ||
}] | ||
""" | ||
When we get "syndicate?formatter=atom" | ||
Then we get OK response | ||
Then we "get" "<title><![CDATA[headline 1]]></title>" in syndicate xml response | ||
Then we "don't get" "<title><![CDATA[headline 2]]></title>" in syndicate xml response | ||
|
||
Scenario: test syndicate atom request search q | ||
Given "items" | ||
""" | ||
[{"body_html": "<p>Once upon a time there was a monkey who could swim</p>", "headline": "headline 1", | ||
"byline": "S Smith", "pubstatus": "usable", "service" : [{"name" : "Australian General News", "code" : "a"}], | ||
"description_text": "summary", | ||
"associations" : { | ||
"featuremedia" : { | ||
"mimetype" : "image/jpeg", | ||
"description_text" : "Deputy Prime Minister Michael McCormack during Question Time", | ||
"version" : "1", | ||
"byline" : "Mick Tsikas/AAP PHOTOS", | ||
"body_text" : "QUESTION TIME ALT", | ||
"renditions" : { | ||
"16-9" : { | ||
"href" : "/assets/5fc5dce16369ab07be3325fa", | ||
"height" : 720, | ||
"width" : 1280, | ||
"media" : "5fc5dce16369ab07be3325fa", | ||
"poi" : { | ||
"x" : 453, | ||
"y" : 335 | ||
}, | ||
"mimetype" : "image/jpeg" | ||
} | ||
} | ||
}}, | ||
"firstpublished": "#DATE-1#", "versioncreated": "#DATE#"}] | ||
""" | ||
When we get "syndicate?formatter=atom&q=monkey" | ||
Then we get OK response | ||
Then we "get" "<title><![CDATA[headline 1]]></title>" in syndicate xml response | ||
Then we "get" "<media:credit>Mick Tsikas/AAP PHOTOS</media:credit>" in syndicate xml response | ||
|
||
Scenario: test atom request with embedded image | ||
Given "products" | ||
""" | ||
[{"name": "A fishy Product", | ||
"decsription": "a product for those interested in fish", | ||
"companies" : [ | ||
"#companies._id#" | ||
], | ||
"query": "fish", | ||
"product_type": "news_api" | ||
}, | ||
{"name": "A pic product", | ||
"decsription": "pic product", | ||
"companies" : [ | ||
"#companies._id#" | ||
], | ||
"query": "", | ||
"sd_product_id": "1", | ||
"product_type": "news_api" | ||
}] | ||
""" | ||
Given "items" | ||
""" | ||
[{"body_html": "<p>Once upon a time there was a fish who could swim</p><!-- EMBED START Image {id: \"editor_19\"} --><figure><img src=\"somthing\" alt=\"alt text\" id=\"editor_19\"<figcaption>Some caption</figcaption></figure><!-- EMBED END Image {id: \"editor_19\"} -->", | ||
"headline": "headline 1", | ||
"byline": "S Smith", "pubstatus": "usable", "service" : [{"name" : "Australian General News", "code" : "a"}], | ||
"description_text": "summary", | ||
"associations" : { | ||
"editor_19" : { | ||
"mimetype" : "image/jpeg", | ||
"description_text" : "Deputy Prime Minister Michael McCormack during Question Time", | ||
"version" : "1", | ||
"byline" : "Mick Tsikas/AAP PHOTOS", | ||
"body_text" : "QUESTION TIME ALT", | ||
"products": [{"code": "1"}], | ||
"renditions" : { | ||
"16-9" : { | ||
"href" : "/assets/5fc5dce16369ab07be3325fa", | ||
"height" : 720, | ||
"width" : 1280, | ||
"media" : "5fc5dce16369ab07be3325fa", | ||
"poi" : { | ||
"x" : 453, | ||
"y" : 335 | ||
}, | ||
"mimetype" : "image/jpeg" | ||
} | ||
} | ||
}}, | ||
"firstpublished": "#DATE-1#", "versioncreated": "#DATE#"}] | ||
""" | ||
When we get "syndicate?formatter=atom" | ||
Then we get OK response | ||
Then we "get" "<title><![CDATA[headline 1]]></title>" in syndicate xml response | ||
Then we "get" "5fc5dce16369ab07be3325fa" in atom xml response | ||
Then we "get" "src="http://" in atom xml response | ||
|
||
Scenario: Atom request response restricted by featured image product | ||
Given "items" | ||
""" | ||
[{"body_html": "Once upon a time there was a fish who could swim", "headline": "headline 1", | ||
"firstpublished": "#DATE-1#", "versioncreated": "#DATE#", | ||
"associations": {"featuremedia": {"products": [{"code": "1234"}], "renditions": {"original": {}} }}}, | ||
{"body_html": "Once upon a time there was a aardvark that could not swim", "headline": "headline 2", | ||
"firstpublished": "#DATE-1#", "versioncreated": "#DATE#", | ||
"associations": {"featuremedia": {"products": [{"code": "4321"}], "renditions": {"original": {}} }}}] | ||
""" | ||
Given "products" | ||
""" | ||
[{"name": "A fishy Product", | ||
"decsription": "a product for those interested in fish", | ||
"companies" : [ | ||
"#companies._id#" | ||
], | ||
"query": "Once upon a time", | ||
"product_type": "news_api" | ||
}, | ||
{"name": "A fishy superdesk product", | ||
"description": "a superdesk product restricting images in the atom feed", | ||
"companies" : [ | ||
"#companies._id#" | ||
], | ||
"sd_product_id": "1234", | ||
"product_type": "news_api" | ||
} | ||
] | ||
""" | ||
When we get "syndicate?formatter=atom" | ||
Then we get OK response | ||
Then we "get" "<title><![CDATA[headline 1]]></title>" in syndicate xml response | ||
Then we "don't get" "<title><![CDATA[headline 2]]></title>" in syndicate xml response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be good only for debugging purposes, otherwise it unnecessarily adds to the output when running tests. You can, however, add the
response_body
as a msg in the assert statement upon failureThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this log entry, not needed. You can instead add this to the assert statement, so it shows in the console IF this step fails