tests: Move URL redirect tests for portico landing pages.

Moves three URL redirect tests in `zerver/tests/test_docs.py` to
the unit test for URL redirects in `zerver/tests/test_urls.py`.
This commit is contained in:
Lauryn Menard 2022-09-05 14:54:58 +02:00 committed by Tim Abbott
parent 39a3944951
commit 9ad6457f32
2 changed files with 4 additions and 11 deletions

View File

@ -188,17 +188,6 @@ class DocPageTest(ZulipTestCase):
) )
self.assertEqual(result.status_code, 404) self.assertEqual(result.status_code, 404)
result = self.client_get("/new-user/")
self.assertEqual(result.status_code, 301)
self.assertIn("hello", result["Location"])
result = self.client_get("/developer-community/")
self.assertEqual(result.status_code, 301)
self.assertIn("development-community", result["Location"])
result = self.client_get("/for/companies/", follow=True)
self.assert_in_success_response(["Communication efficiency represents"], result)
def test_open_organizations_endpoint(self) -> None: def test_open_organizations_endpoint(self) -> None:
realm = get_realm("zulip") realm = get_realm("zulip")
realm.want_advertise_in_communities_directory = True realm.want_advertise_in_communities_directory = True

View File

@ -182,3 +182,7 @@ class RedirectURLTest(ZulipTestCase):
for redirect in LANDING_PAGE_REDIRECTS: for redirect in LANDING_PAGE_REDIRECTS:
result = self.client_get(redirect.old_url, follow=True) result = self.client_get(redirect.old_url, follow=True)
self.assert_in_success_response(["Download"], result) self.assert_in_success_response(["Download"], result)
result = self.client_get(redirect.old_url)
self.assertEqual(result.status_code, 301)
self.assertIn(redirect.new_url, result["Location"])