mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 00:18:12 +00:00
home: Ignore handlebars errors in the test suite.
The handlebars error message is just for the manual development environment; this prevents the state of compiling handlebars templates from run-dev.py from potentially causing the unit tests to fail.
This commit is contained in:
@@ -612,7 +612,7 @@ class HomeTest(ZulipTestCase):
|
|||||||
|
|
||||||
def test_handlebars_compile_error(self) -> None:
|
def test_handlebars_compile_error(self) -> None:
|
||||||
request = HostRequestMock()
|
request = HostRequestMock()
|
||||||
with self.settings(DEVELOPMENT=True):
|
with self.settings(DEVELOPMENT=True, TEST_SUITE=False):
|
||||||
with patch('os.path.exists', return_value=True):
|
with patch('os.path.exists', return_value=True):
|
||||||
result = home(request)
|
result = home(request)
|
||||||
self.assertEqual(result.status_code, 500)
|
self.assertEqual(result.status_code, 500)
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ def get_bot_types(user_profile: UserProfile) -> List[Dict[str, object]]:
|
|||||||
return bot_types
|
return bot_types
|
||||||
|
|
||||||
def home(request: HttpRequest) -> HttpResponse:
|
def home(request: HttpRequest) -> HttpResponse:
|
||||||
if settings.DEVELOPMENT and os.path.exists('var/handlebars-templates/compile.error'):
|
if (settings.DEVELOPMENT and not settings.TEST_SUITE and
|
||||||
|
os.path.exists('var/handlebars-templates/compile.error')):
|
||||||
response = render(request, 'zerver/handlebars_compilation_failed.html')
|
response = render(request, 'zerver/handlebars_compilation_failed.html')
|
||||||
response.status_code = 500
|
response.status_code = 500
|
||||||
return response
|
return response
|
||||||
|
|||||||
Reference in New Issue
Block a user