-
Notifications
You must be signed in to change notification settings - Fork 965
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add project releases RSS feed (#7013)
* Add project releases RSS feed Closes #1683 * Add authors to project releases RSS feeds * Add project releases RSS feed docs * Move project releases feed to /rss/project/{name}/releases.xml * Rename package releases feed to project releases feed in docs * Improve project rss feed example rendering Co-authored-by: Dustin Ingram <[email protected]> * Use descending release date order in RSS feeds Co-authored-by: Dustin Ingram <[email protected]> * Don't overwrite base feeds, provide for adding instead Co-authored-by: Dustin Ingram <[email protected]> * Don't overwrite base feeds, provide for adding instead Co-authored-by: Dustin Ingram <[email protected]> * Don't overwrite base feeds, provide for adding instead Co-authored-by: Dustin Ingram <[email protected]> * Test project releases RSS feed ordering Co-authored-by: Dustin Ingram <[email protected]> * Test project releases RSS feed ordering Co-authored-by: Dustin Ingram <[email protected]> * Add RSS feed link to release history tab Co-authored-by: Dustin Ingram <[email protected]> * Update tests/unit/rss/test_views.py * Update translations Co-authored-by: Dustin Ingram <[email protected]>
- Loading branch information
Showing
11 changed files
with
221 additions
and
103 deletions.
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
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 |
---|---|---|
|
@@ -73,6 +73,35 @@ def test_rss_packages(db_request): | |
assert db_request.response.content_type == "text/xml" | ||
|
||
|
||
def test_rss_project_releases(db_request): | ||
db_request.find_service = pretend.call_recorder( | ||
lambda *args, **kwargs: pretend.stub( | ||
enabled=False, csp_policy=pretend.stub(), merge=lambda _: None | ||
) | ||
) | ||
|
||
db_request.session = pretend.stub() | ||
|
||
project = ProjectFactory.create() | ||
|
||
release_v1 = ReleaseFactory.create(project=project, version="1.0.0") | ||
release_v1.created = datetime.date(2018, 1, 1) | ||
release_v3 = ReleaseFactory.create(project=project, version="3.0.0") | ||
release_v3.created = datetime.date(2019, 1, 1) | ||
release_v2 = ReleaseFactory.create(project=project, version="2.0.0") | ||
release_v2.created = datetime.date(2020, 1, 1) | ||
|
||
release_v3.author_email = "[email protected]" | ||
|
||
assert rss.rss_project_releases(project, db_request) == { | ||
"project": project, | ||
"latest_releases": tuple( | ||
zip((release_v2, release_v3, release_v1), (None, "[email protected]", None)) | ||
), | ||
} | ||
assert db_request.response.content_type == "text/xml" | ||
|
||
|
||
def test_format_author(db_request): | ||
db_request.find_service = pretend.call_recorder( | ||
lambda *args, **kwargs: pretend.stub( | ||
|
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
Oops, something went wrong.