Add monkeypatch to mock handle_error()
This commit is contained in:
parent
6013d93182
commit
1435734969
@ -194,7 +194,7 @@
|
|||||||
"hashed_secret": "e4f14805dfd1e6af030359090c535e149e6b4207",
|
"hashed_secret": "e4f14805dfd1e6af030359090c535e149e6b4207",
|
||||||
"is_secret": false,
|
"is_secret": false,
|
||||||
"is_verified": false,
|
"is_verified": false,
|
||||||
"line_number": 543,
|
"line_number": 638,
|
||||||
"type": "Hex High Entropy String"
|
"type": "Hex High Entropy String"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -74,6 +74,11 @@ def test_all_protected_routes_have_access_control(
|
|||||||
)
|
)
|
||||||
monkeypatch.setattr("atst.app.assign_resources", lambda *a: None)
|
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
|
# patch the internal function the access decorator uses so that
|
||||||
# we can check that it was called
|
# we can check that it was called
|
||||||
mocker.patch("atst.domain.authz.decorator.check_access")
|
mocker.patch("atst.domain.authz.decorator.check_access")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user