docs: Remove `settings_html` and `subscriptions_html` from api url context.

Removes the now unused `settings_html` and `subscriptions_html`
links / text when adding a documentation pages' API URL context
information.
This commit is contained in:
Lauryn Menard 2022-11-28 16:20:47 +01:00 committed by Tim Abbott
parent 93e892af92
commit 8bad751b82
2 changed files with 0 additions and 30 deletions

View File

@ -369,28 +369,6 @@ class IntegrationTest(ZulipTestCase):
self.assertEqual(context["api_url"], "http://mysubdomain.testserver/api")
self.assertTrue(context["html_settings_links"])
def test_html_settings_links(self) -> None:
context: Dict[str, Any] = {}
with self.settings(ROOT_DOMAIN_LANDING_PAGE=True):
add_api_uri_context(context, HostRequestMock())
self.assertEqual(context["settings_html"], "Zulip settings page")
self.assertEqual(context["subscriptions_html"], "streams page")
context = {}
with self.settings(ROOT_DOMAIN_LANDING_PAGE=True):
add_api_uri_context(context, HostRequestMock(host="mysubdomain.testserver"))
self.assertEqual(context["settings_html"], '<a href="/#settings">Zulip settings page</a>')
self.assertEqual(
context["subscriptions_html"], '<a target="_blank" href="/#streams">streams page</a>'
)
context = {}
add_api_uri_context(context, HostRequestMock())
self.assertEqual(context["settings_html"], '<a href="/#settings">Zulip settings page</a>')
self.assertEqual(
context["subscriptions_html"], '<a target="_blank" href="/#streams">streams page</a>'
)
class AboutPageTest(ZulipTestCase):
@skipUnless(settings.ZILENCER_ENABLED, "requires zilencer")

View File

@ -56,14 +56,6 @@ def add_api_uri_context(context: Dict[str, Any], request: HttpRequest) -> None:
context["zulip_url"] = zulip_url
context["html_settings_links"] = html_settings_links
if html_settings_links:
settings_html = '<a href="/#settings">Zulip settings page</a>'
subscriptions_html = '<a target="_blank" href="/#streams">streams page</a>'
else:
settings_html = "Zulip settings page"
subscriptions_html = "streams page"
context["settings_html"] = settings_html
context["subscriptions_html"] = subscriptions_html
class ApiURLView(TemplateView):