mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
change(python): refactor & centralize comaintainer management
This commit centralizes comaintainer management with a few new functions and uses them more appropriately within routes: - aurweb.packages.util.latest_priority - aurweb.packages.util.remove_comaintainer - aurweb.packages.util.remove_comaintainers - aurweb.packages.util.add_comaintainer - aurweb.packages.util.add_comaintainers - aurweb.packages.util.rotate_comaintainers Closes #117 Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
9d3e77bab1
commit
fc229d755b
3 changed files with 151 additions and 82 deletions
|
@ -75,14 +75,19 @@ def client() -> TestClient:
|
|||
yield TestClient(app=asgi.app)
|
||||
|
||||
|
||||
def create_user(username: str) -> User:
|
||||
with db.begin():
|
||||
user = db.create(User, Username=username,
|
||||
Email=f"{username}@example.org",
|
||||
Passwd="testPassword",
|
||||
AccountTypeID=USER_ID)
|
||||
return user
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def user() -> User:
|
||||
""" Yield a user. """
|
||||
with db.begin():
|
||||
user = db.create(User, Username="test",
|
||||
Email="test@example.org",
|
||||
Passwd="testPassword",
|
||||
AccountTypeID=USER_ID)
|
||||
user = create_user("test")
|
||||
yield user
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue