mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
refactored the requires_auth handler to raise exceptions
hopefully cleans up code flow and readability [a tiny bit]. raise an AuthException in auth.py, and catch it in errors.py to save on returning error_repsonse values throughout the function
This commit is contained in:
@@ -171,9 +171,9 @@ def test_authentication_returns_token_expired_when_service_uses_expired_key_and_
|
||||
assert data['message'] == {"token": ['Invalid token: revoked']}
|
||||
|
||||
|
||||
def test_authentication_returns_error_when_api_client_has_no_secrets(notify_api,
|
||||
notify_db,
|
||||
notify_db_session):
|
||||
def test_authentication_returns_error_when_admin_client_has_no_secrets(notify_api,
|
||||
notify_db,
|
||||
notify_db_session):
|
||||
with notify_api.test_request_context():
|
||||
with notify_api.test_client() as client:
|
||||
api_secret = notify_api.config.get('ADMIN_CLIENT_SECRET')
|
||||
|
||||
Reference in New Issue
Block a user