mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
HomeTest: Extract page_params keys to be used in other functions.
This commit is contained in:
@@ -35,25 +35,9 @@ from zerver.worker.queue_processors import UserActivityWorker
|
||||
logger_string = "zulip.soft_deactivation"
|
||||
|
||||
class HomeTest(ZulipTestCase):
|
||||
def test_home(self) -> None:
|
||||
|
||||
# Keep this list sorted!!!
|
||||
html_bits = [
|
||||
'Compose your message here...',
|
||||
'Exclude messages with topic',
|
||||
'Keyboard shortcuts',
|
||||
'Loading...',
|
||||
'Manage streams',
|
||||
'Narrow to topic',
|
||||
'Next message',
|
||||
'Search streams',
|
||||
# Verify that the app styles get included
|
||||
'app-stubentry.js',
|
||||
'data-params',
|
||||
]
|
||||
|
||||
# Keep this list sorted!!!
|
||||
expected_keys = [
|
||||
expected_page_params_keys = [
|
||||
"alert_words",
|
||||
"available_notification_sounds",
|
||||
"avatar_source",
|
||||
@@ -233,6 +217,22 @@ class HomeTest(ZulipTestCase):
|
||||
"zulip_version",
|
||||
]
|
||||
|
||||
def test_home(self) -> None:
|
||||
# Keep this list sorted!!!
|
||||
html_bits = [
|
||||
'Compose your message here...',
|
||||
'Exclude messages with topic',
|
||||
'Keyboard shortcuts',
|
||||
'Loading...',
|
||||
'Manage streams',
|
||||
'Narrow to topic',
|
||||
'Next message',
|
||||
'Search streams',
|
||||
# Verify that the app styles get included
|
||||
'app-stubentry.js',
|
||||
'data-params',
|
||||
]
|
||||
|
||||
# Verify fails if logged-out
|
||||
result = self.client_get('/')
|
||||
self.assertEqual(result.status_code, 302)
|
||||
@@ -267,7 +267,7 @@ class HomeTest(ZulipTestCase):
|
||||
|
||||
actual_keys = sorted(str(k) for k in page_params.keys())
|
||||
|
||||
self.assertEqual(actual_keys, expected_keys)
|
||||
self.assertEqual(actual_keys, self.expected_page_params_keys)
|
||||
|
||||
# TODO: Inspect the page_params data further.
|
||||
# print(orjson.dumps(page_params, option=orjson.OPT_INDENT_2).decode())
|
||||
|
||||
Reference in New Issue
Block a user