aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/auth/test_roles.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/auth/test_roles.py')
-rw-r--r--tests/unit/auth/test_roles.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/unit/auth/test_roles.py b/tests/unit/auth/test_roles.py
index 67654d8..227cb9e 100644
--- a/tests/unit/auth/test_roles.py
+++ b/tests/unit/auth/test_roles.py
@@ -16,8 +16,6 @@ create_role_failure = {
"message": "Unauthorised: Could not create role"
}
-uuid_fn = lambda : uuid.UUID("d32611e3-07fc-4564-b56c-786c6db6de2b")
-
PRIVILEGES = (
Privilege("group:resource:view-resource",
"view a resource and use it in computations"),
@@ -36,7 +34,7 @@ def test_create_role(# pylint: disable=[too-many-arguments]
THEN: verify they are only able to create the role if they have the
appropriate privileges
"""
- mocker.patch("gn_auth.auth.authorisation.roles.models.uuid4", uuid_fn)
+ mocker.patch("gn_auth.auth.authorisation.roles.models.uuid4", conftest.uuid_fn)
mocker.patch("gn_auth.auth.authorisation.checks.require_oauth.acquire",
conftest.get_tokeniser(user))
with db.connection(auth_testdb_path) as conn, db.cursor(conn) as cursor:
@@ -55,7 +53,7 @@ def test_create_role_raises_exception_for_unauthorised_users(# pylint: disable=[
THEN: verify they are only able to create the role if they have the
appropriate privileges
"""
- mocker.patch("gn_auth.auth.authorisation.roles.models.uuid4", uuid_fn)
+ mocker.patch("gn_auth.auth.authorisation.roles.models.uuid4", conftest.uuid_fn)
mocker.patch("gn_auth.auth.authorisation.checks.require_oauth.acquire",
conftest.get_tokeniser(user))
with db.connection(auth_testdb_path) as conn, db.cursor(conn) as cursor: