def test_router_missing_error_message_fail(db_session): """Test that failing with a bad error message is handled.""" router = ModelResourceRouter(session=db_session) with raises(AssertionError): router.make_error(key="test")
def test_router_generic_fail(db_session): """Test router fail method with a generic problem.""" resource = AlbumResource(session=db_session) router = ModelResourceRouter(session=db_session, resource=resource) error = router.make_error("invalid_complex_filters") assert isinstance(error, BadRequestError)