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:
Chris Hill-Scott
2022-06-06 10:38:34 +01:00
parent 3c25de3f85
commit 84d4c1e0b5

View File

@@ -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