mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 05:53:43 +00:00
test_public_urls: Automate test files (in templates/zerver/help/).
This automates including of markdown files under `templates/zerver/help/` to be tested by `test_public_urls` (in zerver/tests/test_signup.py). Fixes #2465.
This commit is contained in:
@@ -43,6 +43,7 @@ from six.moves import urllib
|
|||||||
from six.moves import range
|
from six.moves import range
|
||||||
import six
|
import six
|
||||||
from typing import Any, Text
|
from typing import Any, Text
|
||||||
|
import os
|
||||||
|
|
||||||
class PublicURLTest(ZulipTestCase):
|
class PublicURLTest(ZulipTestCase):
|
||||||
"""
|
"""
|
||||||
@@ -79,6 +80,13 @@ class PublicURLTest(ZulipTestCase):
|
|||||||
],
|
],
|
||||||
404: ["/help/nonexistent"],
|
404: ["/help/nonexistent"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Add all files in 'templates/zerver/help' directory (except for 'main.html' and
|
||||||
|
# 'index.md') to `get_urls['200']` list.
|
||||||
|
for doc in os.listdir('./templates/zerver/help'):
|
||||||
|
if doc not in {'main.html', 'index.md'}:
|
||||||
|
get_urls[200].append('/help/' + os.path.splitext(doc)[0]) # Strip the extension.
|
||||||
|
|
||||||
post_urls = {200: ["/accounts/login/"],
|
post_urls = {200: ["/accounts/login/"],
|
||||||
302: ["/accounts/logout/"],
|
302: ["/accounts/logout/"],
|
||||||
401: ["/json/messages",
|
401: ["/json/messages",
|
||||||
|
|||||||
Reference in New Issue
Block a user