Enable debug mode in tests.

Debug mode allows route integration tests to raise explicit exceptions on
errors, instead of returning error pages. Some portions of the test
suite need to be able to ignore exceptions (the response is not under
test) so they use a separate pytest fixture version of the app and
client that are configured with debug disabled, as it would be in
production.
This commit is contained in:
dandds
2019-08-29 13:07:24 -04:00
parent 094e44a6b0
commit 883947b75f
8 changed files with 82 additions and 32 deletions

View File

@@ -1,5 +1,5 @@
from flask import url_for
from unittest.mock import Mock
from unittest.mock import MagicMock
from atst.domain.permission_sets import PermissionSets
from atst.domain.portfolio_roles import PortfolioRoles
@@ -129,7 +129,7 @@ def test_rerender_admin_page_if_member_perms_form_does_not_validate(
"members_permissions-0-perms_portfolio_mgmt": "view_portfolio_admin",
}
mock_route = Mock()
mock_route = MagicMock(return_value=("", 200, {}))
monkeypatch.setattr("atst.routes.portfolios.admin.render_admin_page", mock_route)
client.post(
url_for("portfolios.edit_members", portfolio_id=portfolio.id), data=form_data