mirror of https://github.com/zulip/zulip.git
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:
parent
7d6bb3dcb4
commit
e087be6630
|
@ -612,7 +612,7 @@ class HomeTest(ZulipTestCase):
|
|||
|
||||
def test_handlebars_compile_error(self) -> None:
|
||||
request = HostRequestMock()
|
||||
with self.settings(DEVELOPMENT=True):
|
||||
with self.settings(DEVELOPMENT=True, TEST_SUITE=False):
|
||||
with patch('os.path.exists', return_value=True):
|
||||
result = home(request)
|
||||
self.assertEqual(result.status_code, 500)
|
||||
|
|
|
@ -75,7 +75,8 @@ def get_bot_types(user_profile: UserProfile) -> List[Dict[str, object]]:
|
|||
return bot_types
|
||||
|
||||
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.status_code = 500
|
||||
return response
|
||||
|
|
Loading…
Reference in New Issue