First product
This commit is contained in:
parent
778da9e2fc
commit
4433d7d2c4
157 changed files with 23975 additions and 0 deletions
46
tests/smoke/test_migration_schema.py
Normal file
46
tests/smoke/test_migration_schema.py
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
import pytest
|
||||
from sqlalchemy import text
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
@pytest.mark.smoke
|
||||
@pytest.mark.db
|
||||
@pytest.mark.asyncio
|
||||
async def test_schema_head_revision_is_available(db_session: AsyncSession) -> None:
|
||||
result = await db_session.execute(text("SELECT version_num FROM alembic_version"))
|
||||
assert result.scalar_one() == "20260217_0004"
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
@pytest.mark.smoke
|
||||
@pytest.mark.db
|
||||
@pytest.mark.asyncio
|
||||
async def test_user_table_exists_in_public_schema(db_session: AsyncSession) -> None:
|
||||
result = await db_session.execute(
|
||||
text(
|
||||
"""
|
||||
SELECT 1
|
||||
FROM pg_tables
|
||||
WHERE schemaname = 'public' AND tablename = 'users'
|
||||
"""
|
||||
)
|
||||
)
|
||||
assert result.scalar_one() == 1
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
@pytest.mark.smoke
|
||||
@pytest.mark.db
|
||||
@pytest.mark.asyncio
|
||||
async def test_users_table_includes_admin_column(db_session: AsyncSession) -> None:
|
||||
result = await db_session.execute(
|
||||
text(
|
||||
"""
|
||||
SELECT 1
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 'users' AND column_name = 'is_admin'
|
||||
"""
|
||||
)
|
||||
)
|
||||
assert result.scalar_one() == 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue