File size: 591 Bytes
7c6ffa6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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