mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 12:21:58 +00:00
docs: Fix /help/ sidebar being accidentally missing.
Apparently, we didn't have a test for this, and it was broken in a recent refactoring.
This commit is contained in:
@@ -171,8 +171,10 @@ class DocPageTest(ZulipTestCase):
|
|||||||
class HelpTest(ZulipTestCase):
|
class HelpTest(ZulipTestCase):
|
||||||
def test_help_settings_links(self) -> None:
|
def test_help_settings_links(self) -> None:
|
||||||
result = self.client_get('/help/change-the-time-format')
|
result = self.client_get('/help/change-the-time-format')
|
||||||
self.assertIn('Go to <a href="/#settings/display-settings">Display settings</a>', str(result.content))
|
|
||||||
self.assertEqual(result.status_code, 200)
|
self.assertEqual(result.status_code, 200)
|
||||||
|
self.assertIn('Go to <a href="/#settings/display-settings">Display settings</a>', str(result.content))
|
||||||
|
# Check that the sidebar was rendered properly.
|
||||||
|
self.assertIn('Getting started with Zulip', str(result.content))
|
||||||
|
|
||||||
with self.settings(ROOT_DOMAIN_LANDING_PAGE=True):
|
with self.settings(ROOT_DOMAIN_LANDING_PAGE=True):
|
||||||
result = self.client_get('/help/change-the-time-format', subdomain="")
|
result = self.client_get('/help/change-the-time-format', subdomain="")
|
||||||
|
|||||||
@@ -71,9 +71,10 @@ class MarkdownDirectoryView(ApiURLView):
|
|||||||
elif "/" in article:
|
elif "/" in article:
|
||||||
article = "missing"
|
article = "missing"
|
||||||
http_status = 404
|
http_status = 404
|
||||||
if len(article) > 100 or not re.match('^[0-9a-zA-Z_-]+$', article):
|
elif len(article) > 100 or not re.match('^[0-9a-zA-Z_-]+$', article):
|
||||||
article = "missing"
|
article = "missing"
|
||||||
http_status = 404
|
http_status = 404
|
||||||
|
|
||||||
path = self.path_template % (article,)
|
path = self.path_template % (article,)
|
||||||
try:
|
try:
|
||||||
loader.get_template(path)
|
loader.get_template(path)
|
||||||
|
|||||||
Reference in New Issue
Block a user