-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
urls: Fix redirects of pages with arguments
- Loading branch information
Showing
3 changed files
with
28 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,7 @@ | |
"publisher/zsl.html", | ||
"codelist/2/[email protected]", | ||
"element/[email protected]", | ||
"org_type/.html", | ||
"org_type/accountable_org.html", | ||
"registration_agencies.html", | ||
] | ||
|
||
|
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 |
---|---|---|
|
@@ -152,6 +152,8 @@ class OriginalDashboardRedirectTests(TestCase): | |
list the tests as they run. | ||
""" | ||
|
||
fixtures = ["publishers"] | ||
|
||
def _url_and_view_helper(self, urls_and_views_to_check): | ||
"""Checks that a set of URLs redirect to matching view functions""" | ||
|
||
|
@@ -236,20 +238,28 @@ def test_exploringdata(self): | |
) | ||
|
||
def test_slug_page_redirects(self): | ||
"""Test pages with slugs redirect to the section page""" | ||
"""Test pages with slugs redirect to their new locations""" | ||
|
||
self.assertRedirects( | ||
self.client.get(r"/publisher/zsl.html"), reverse("dash-headlines-publishers"), status_code=301 | ||
self.client.get(r"/publisher/zsl.html"), | ||
reverse("dash-headlines-publisher-detail", args=["zsl"]), | ||
status_code=301, | ||
) | ||
self.assertRedirects(self.client.get(r"/license/cc-by.html"), reverse("dash-licenses"), status_code=301) | ||
self.assertRedirects( | ||
self.client.get(r"/codelist/2/[email protected]"), reverse("dash-exploringdata-codelists"), status_code=301 | ||
self.client.get(r"/license/cc-by.html"), reverse("dash-licenses-detail", args=["cc-by"]), status_code=301 | ||
) | ||
self.assertRedirects( | ||
self.client.get(r"/codelist/2/[email protected]"), | ||
reverse("dash-exploringdata-codelists-detail", args=["2", "budget_@type"]), | ||
status_code=301, | ||
) | ||
self.assertRedirects( | ||
self.client.get(r"/element/[email protected]"), | ||
reverse("dash-exploringdata-elements"), | ||
reverse("dash-exploringdata-elements-detail", args=["iati-activity_activity-date_@iso-date"]), | ||
status_code=301, | ||
) | ||
self.assertRedirects( | ||
self.client.get(r"/org_type/funding_org.html"), reverse("dash-exploringdata-orgids"), status_code=301 | ||
self.client.get(r"/org_type/funding_org.html"), | ||
reverse("dash-exploringdata-orgtypes-detail", args=["funding_org"]), | ||
status_code=301, | ||
) |
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