DocDoeAI / tests /test_database_repair_sql.py
asnannp's picture
Deploy backend cd4237ff: support routes + rate limit + exam_date nullable + upload 413 fix
7c6ffa6
Raw
History Blame Contribute Delete
591 Bytes
from __future__ import annotations
from pathlib import Path
def test_phase_1_3_manual_migration_has_no_null_bytes() -> None:
migration = Path(__file__).resolve().parents[1] / "migrations" / "phase_1_3_manual.sql"
assert b"\x00" not in migration.read_bytes()
def test_phase_1_3_manual_migration_uses_postgres_boolean_default() -> None:
migration = Path(__file__).resolve().parents[1] / "migrations" / "phase_1_3_manual.sql"
sql = migration.read_text(encoding="utf-8")
assert "official_source BOOLEAN NOT NULL DEFAULT FALSE" in sql
assert "DEFAULT 0" not in sql