Add monkeypatch to mock handle_error()

This commit is contained in:
leigh-mil 2019-09-30 13:29:20 -04:00
parent 6013d93182
commit 1435734969
2 changed files with 6 additions and 1 deletions

View File

@ -194,7 +194,7 @@
"hashed_secret": "e4f14805dfd1e6af030359090c535e149e6b4207",
"is_secret": false,
"is_verified": false,
"line_number": 543,
"line_number": 638,
"type": "Hex High Entropy String"
}
]

View File

@ -74,6 +74,11 @@ def test_all_protected_routes_have_access_control(
)
monkeypatch.setattr("atst.app.assign_resources", lambda *a: None)
# monkeypatch the error handler
monkeypatch.setattr(
"atst.routes.errors.handle_error", lambda *a, **k: ("error", 500)
)
# patch the internal function the access decorator uses so that
# we can check that it was called
mocker.patch("atst.domain.authz.decorator.check_access")