mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 19:03:30 -05:00
Remove catching of exception that is never raised
View functions won’t raise an `Unauthorized` exception, they will return a redirect to the login page instead.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
from flask import request
|
||||
from werkzeug.exceptions import Forbidden, Unauthorized
|
||||
from werkzeug.exceptions import Forbidden
|
||||
|
||||
from app.main.views.index import index
|
||||
from app.utils.user import user_has_permissions
|
||||
@@ -30,7 +30,7 @@ def _test_permissions(
|
||||
response.status_code == 302
|
||||
):
|
||||
pytest.fail("Failed to throw a forbidden or unauthorised exception")
|
||||
except (Forbidden, Unauthorized):
|
||||
except Forbidden:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user