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:
Tim Abbott
2018-12-06 10:11:02 -08:00
parent 55b875f6c9
commit 9da4b58c8e
2 changed files with 5 additions and 2 deletions

View File

@@ -171,8 +171,10 @@ class DocPageTest(ZulipTestCase):
class HelpTest(ZulipTestCase):
def test_help_settings_links(self) -> None:
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.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):
result = self.client_get('/help/change-the-time-format', subdomain="")

View File

@@ -71,9 +71,10 @@ class MarkdownDirectoryView(ApiURLView):
elif "/" in article:
article = "missing"
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"
http_status = 404
path = self.path_template % (article,)
try:
loader.get_template(path)