*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 3eef9237 authored by Moser, Maximilian's avatar Moser, Maximilian
Browse files

Add "roles" fixture to tests

parent 30a75ee6
No related branches found
No related tags found
1 merge request!90Send notification about started review to other reviewers
...@@ -145,6 +145,21 @@ def users(app, db): ...@@ -145,6 +145,21 @@ def users(app, db):
return [user1, user2] return [user1, user2]
@pytest.fixture()
def roles(app, db):
"""Create required roles."""
with db.session.begin_nested():
datastore = app.extensions["security"].datastore
role = datastore.create_role(
id=app.config["CURATIONS_MODERATION_ROLE"],
name=app.config["CURATIONS_MODERATION_ROLE"],
description="Publication request reviewers",
)
db.session.commit()
return [role]
@pytest.fixture() @pytest.fixture()
def client_with_login(client, users): def client_with_login(client, users):
"""A test client for the app with a logged-in user.""" """A test client for the app with a logged-in user."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment