Fix migration 001 - add base table creation for mtgonline_users, mtgonline_decklist_files, and mtgonline_rooms
This commit is contained in:
@@ -15,7 +15,7 @@ class TestAdminEndpoints:
|
||||
@pytest.mark.asyncio
|
||||
async def test_list_users_admin(self, client: AsyncClient, admin_headers: dict):
|
||||
"""Test listing users as admin."""
|
||||
response = await client.get("/api/v1/admin/users", headers=admin_headers)
|
||||
response = await client.get("/admin/users", headers=admin_headers)
|
||||
print(f"\nDEBUG: status={response.status_code}, body={response.text}")
|
||||
if response.status_code != 200:
|
||||
print(f"DEBUG: response.json()={response.json()}")
|
||||
@@ -26,14 +26,14 @@ class TestAdminEndpoints:
|
||||
@pytest.mark.asyncio
|
||||
async def test_list_users_non_admin(self, client: AsyncClient, auth_headers: dict):
|
||||
"""Test listing users as non-admin."""
|
||||
response = await client.get("/api/v1/admin/users", headers=auth_headers)
|
||||
response = await client.get("/admin/users", headers=auth_headers)
|
||||
assert response.status_code == 403
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_create_ban(self, client: AsyncClient, admin_headers: dict, test_user: User):
|
||||
"""Test creating a ban."""
|
||||
response = await client.post(
|
||||
"/api/v1/admin/bans",
|
||||
"/admin/bans",
|
||||
json={
|
||||
"user_id": test_user.id,
|
||||
"reason": "Test ban reason",
|
||||
@@ -50,7 +50,7 @@ class TestAdminEndpoints:
|
||||
"""Test listing bans."""
|
||||
# Create a ban first
|
||||
await client.post(
|
||||
"/api/v1/admin/bans",
|
||||
"/admin/bans",
|
||||
json={
|
||||
"user_id": test_user.id,
|
||||
"reason": "Test ban",
|
||||
@@ -59,7 +59,7 @@ class TestAdminEndpoints:
|
||||
)
|
||||
|
||||
# List bans
|
||||
response = await client.get("/api/v1/admin/bans", headers=admin_headers)
|
||||
response = await client.get("/admin/bans", headers=admin_headers)
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert isinstance(data, list)
|
||||
@@ -70,7 +70,7 @@ class TestAdminEndpoints:
|
||||
"""Test unbanning a user."""
|
||||
# Create a ban first
|
||||
ban_response = await client.post(
|
||||
"/api/v1/admin/bans",
|
||||
"/admin/bans",
|
||||
json={
|
||||
"user_id": test_user.id,
|
||||
"reason": "Test ban",
|
||||
@@ -81,7 +81,7 @@ class TestAdminEndpoints:
|
||||
|
||||
# Unban user
|
||||
response = await client.post(
|
||||
f"/api/v1/admin/bans/{ban_id}/unban",
|
||||
f"/admin/bans/{ban_id}/unban",
|
||||
headers=admin_headers,
|
||||
)
|
||||
assert response.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user