|
@@ -73,12 +73,23 @@ class ReactPageViewTest(TestCase):
|
|
|
self.assertTemplateUsed(resp, "sentry/bases/react.html")
|
|
|
assert resp.context["request"]
|
|
|
|
|
|
- def test_org_settings_captures_slug(self):
|
|
|
+ def test_org_subpages_capture_slug(self):
|
|
|
owner = self.create_user("bar@example.com")
|
|
|
org = self.create_organization(owner=owner)
|
|
|
- path = f"/settings/{org.slug}/some-page/"
|
|
|
-
|
|
|
# User is *not* logged in. Check for redirect to org's auth login.
|
|
|
- resp = self.client.get(path)
|
|
|
- assert resp.status_code == 302
|
|
|
- assert resp.url == f"/auth/login/{org.slug}/"
|
|
|
+
|
|
|
+ # TODO(RyanSkonnord): Generalize URL pattern; add
|
|
|
+ # f"/organizations/{org.slug}/new_page_that_does_not_exist_yet/"
|
|
|
+ # to list of test paths without causing other regressions.
|
|
|
+ # See OrganizationReleasesTest.test_detail_global_header,
|
|
|
+ # which exposes a buggy interaction with appendTrailingSlash
|
|
|
+ # in static/app/routes.tsx.
|
|
|
+ for path in [
|
|
|
+ f"/organizations/{org.slug}/settings/",
|
|
|
+ f"/organizations/{org.slug}/discover/",
|
|
|
+ f"/settings/{org.slug}/developer-settings/",
|
|
|
+ f"/settings/{org.slug}/new_page_that_does_not_exist_yet/",
|
|
|
+ ]:
|
|
|
+ resp = self.client.get(path)
|
|
|
+ assert resp.status_code == 302
|
|
|
+ assert resp.url == f"/auth/login/{org.slug}/"
|