mirror of https://github.com/zulip/zulip.git
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:
parent
93e892af92
commit
8bad751b82
|
@ -369,28 +369,6 @@ class IntegrationTest(ZulipTestCase):
|
||||||
self.assertEqual(context["api_url"], "http://mysubdomain.testserver/api")
|
self.assertEqual(context["api_url"], "http://mysubdomain.testserver/api")
|
||||||
self.assertTrue(context["html_settings_links"])
|
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):
|
class AboutPageTest(ZulipTestCase):
|
||||||
@skipUnless(settings.ZILENCER_ENABLED, "requires zilencer")
|
@skipUnless(settings.ZILENCER_ENABLED, "requires zilencer")
|
||||||
|
|
|
@ -56,14 +56,6 @@ def add_api_uri_context(context: Dict[str, Any], request: HttpRequest) -> None:
|
||||||
context["zulip_url"] = zulip_url
|
context["zulip_url"] = zulip_url
|
||||||
|
|
||||||
context["html_settings_links"] = html_settings_links
|
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):
|
class ApiURLView(TemplateView):
|
||||||
|
|
Loading…
Reference in New Issue