Exception handling enhancement
This commit is contained in:
16
tests/fixtures/auth_fixtures.py
vendored
16
tests/fixtures/auth_fixtures.py
vendored
@@ -48,6 +48,22 @@ def test_admin(db, auth_manager):
|
||||
db.refresh(admin)
|
||||
return admin
|
||||
|
||||
@pytest.fixture
|
||||
def another_admin(db, auth_manager):
|
||||
"""Create another test admin user for testing admin-to-admin interactions"""
|
||||
unique_id = str(uuid.uuid4())[:8] # Short unique identifier
|
||||
hashed_password = auth_manager.hash_password("anotheradminpass123")
|
||||
admin = User(
|
||||
email=f"another_admin_{unique_id}@example.com",
|
||||
username=f"another_admin_{unique_id}",
|
||||
hashed_password=hashed_password,
|
||||
role="admin",
|
||||
is_active=True,
|
||||
)
|
||||
db.add(admin)
|
||||
db.commit()
|
||||
db.refresh(admin)
|
||||
return admin
|
||||
|
||||
@pytest.fixture
|
||||
def other_user(db, auth_manager):
|
||||
|
||||
Reference in New Issue
Block a user