M8-T03: adopt DSMR history into meter sources

This commit is contained in:
2026-08-23 21:22:05 +02:00
parent a78401c2ef
commit 28486a83c7
7 changed files with 628 additions and 29 deletions
+4 -2
View File
@@ -139,7 +139,9 @@ def test_populated_revision_14_upgrades_to_meter_source_head_with_audit(tmp_path
finally:
engine.dispose()
command.upgrade(config, "head")
# This T01 fixture intentionally audits the schema-only revision 15.
# Revision 16 has its own DSMR-history adoption fixture.
command.upgrade(config, "20260822_15_meter_sources")
engine = _engine_with_foreign_keys(database_url)
try:
@@ -187,7 +189,7 @@ def test_populated_revision_14_upgrades_to_meter_source_head_with_audit(tmp_path
assert cost_fks["contract_version_id"]["referred_table"] == "energy_contract_version"
assert cost_fks["source_binding_id"]["referred_table"] == "meter_source_binding"
command.upgrade(config, "head")
command.upgrade(config, "20260822_15_meter_sources")
assert {
table_name: engine.connect().execute(text(f"SELECT COUNT(*) FROM {table_name}")).scalar_one()
for table_name in before_counts