Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions tests/integration/test_api_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ async def test_full_guild_with_all_configs_lifecycle(
# DELETE guild (should cascade)
await db_session.delete(guild)
await db_session.flush()
await db_session.commit()

# VERIFY cascade deleted all configs
guild_check = await db_session.execute(select(Guild).where(Guild.guild_id == 9999))
Expand Down Expand Up @@ -333,7 +332,6 @@ async def test_guild_with_multiple_sotags_and_users(
db_session.add(so_tag)

await db_session.flush()
await db_session.commit()

# Verify all tags exist
result = await db_session.execute(select(SOTagsConfig).where(SOTagsConfig.guild_id == 8888))
Expand Down Expand Up @@ -489,10 +487,9 @@ async def test_pagination_offset_and_limit(
db_session.add(guild)

await db_session.flush()
await db_session.commit()

# Test with explicit limit
response = await api_client.get("/api/guilds/list?pageSize=5")
response = await api_client.get("/api/guilds/list?limit=5")
if response.status_code == HTTP_200_OK:
data = response.json()
# Should respect page size limit
Expand Down Expand Up @@ -528,7 +525,6 @@ async def test_duplicate_guild_id_rejected(
guild1 = Guild(guild_id=5555, guild_name="First Guild")
db_session.add(guild1)
await db_session.flush()
await db_session.commit()

# Try to create duplicate - should raise integrity error
from sqlalchemy.exc import IntegrityError
Expand All @@ -539,8 +535,6 @@ async def test_duplicate_guild_id_rejected(
with pytest.raises(IntegrityError):
await db_session.flush()

await db_session.rollback()

async def test_foreign_key_constraint_enforced(
self,
db_session: AsyncSession,
Expand Down Expand Up @@ -597,12 +591,10 @@ async def test_cascade_delete_all_related_configs(

db_session.add_all([github, forum, so_tag])
await db_session.flush()
await db_session.commit()

# Delete guild
await db_session.delete(guild)
await db_session.flush()
await db_session.commit()

# Verify all configs deleted
github_check = await db_session.execute(select(GitHubConfig).where(GitHubConfig.guild_id == 4444))
Expand Down
Loading