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:
Tim Abbott
2018-04-28 13:46:59 -07:00
parent 7d6bb3dcb4
commit e087be6630
2 changed files with 3 additions and 2 deletions

View File

@@ -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