Skip to content

Commit 78aea43

Browse files
committed
Fix national target test compatibility
1 parent fa2a55c commit 78aea43

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

policyengine_us_data/tests/test_etl_national_targets.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
create_database,
99
)
1010
from policyengine_us_data.db.etl_national_targets import (
11-
TAX_EXPENDITURE_REFORM_ID,
1211
load_national_targets,
1312
)
1413

@@ -90,13 +89,15 @@ def test_load_national_targets_deactivates_stale_baseline_rows(tmp_path, monkeyp
9089
tax_expenditure_df = pd.DataFrame(
9190
[
9291
{
92+
"reform_id": 1,
9393
"variable": "salt_deduction",
9494
"value": 21.247e9,
9595
"source": "Joint Committee on Taxation",
9696
"notes": "SALT deduction tax expenditure",
9797
"year": 2024,
9898
},
9999
{
100+
"reform_id": 5,
100101
"variable": "qualified_business_income_deduction",
101102
"value": 63.1e9,
102103
"source": "Joint Committee on Taxation",
@@ -124,16 +125,12 @@ def test_load_national_targets_deactivates_stale_baseline_rows(tmp_path, monkeyp
124125
assert stale_rows
125126
assert all(not target.active for target in stale_rows)
126127

127-
reform_rows = (
128-
session.query(Target)
129-
.filter(Target.reform_id == TAX_EXPENDITURE_REFORM_ID)
130-
.all()
131-
)
128+
reform_rows = session.query(Target).filter(Target.reform_id > 0).all()
132129
assert len(reform_rows) == 2
133130
assert all(target.active for target in reform_rows)
134-
assert {target.variable for target in reform_rows} == {
135-
"salt_deduction",
136-
"qualified_business_income_deduction",
131+
assert {(target.variable, target.reform_id) for target in reform_rows} == {
132+
("salt_deduction", 1),
133+
("qualified_business_income_deduction", 5),
137134
}
138135
assert all(
139136
"Modeled as repeal-based income tax expenditure target"

0 commit comments

Comments
 (0)