Initial build out
This commit is contained in:
parent
f037c50736
commit
29215e2bd2
40 changed files with 2622 additions and 0 deletions
47
tests/test_irs990_parser.py
Normal file
47
tests/test_irs990_parser.py
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
from admin_analytics.irs990.parser import parse_xml, parse_filing, parse_part_vii, parse_schedule_j
|
||||
|
||||
|
||||
def test_parse_filing(fixtures_dir):
|
||||
root = parse_xml(fixtures_dir / "990_sample.xml")
|
||||
filing = parse_filing(root)
|
||||
assert filing["ein"] == "516000297"
|
||||
assert filing["tax_year"] == 2022
|
||||
assert filing["organization_name"] == "UNIVERSITY OF DELAWARE"
|
||||
assert filing["return_type"] == "990"
|
||||
assert filing["total_revenue"] == 1800000000
|
||||
assert filing["total_expenses"] == 1700000000
|
||||
assert filing["total_assets"] == 5000000000
|
||||
|
||||
|
||||
def test_parse_part_vii(fixtures_dir):
|
||||
root = parse_xml(fixtures_dir / "990_sample.xml")
|
||||
people = parse_part_vii(root)
|
||||
assert len(people) == 3
|
||||
|
||||
president = people[0]
|
||||
assert president["person_name"] == "JOHN DOE"
|
||||
assert president["title"] == "PRESIDENT"
|
||||
assert president["avg_hours_per_week"] == 40.0
|
||||
assert president["reportable_comp_from_org"] == 850000
|
||||
|
||||
trustee = people[2]
|
||||
assert trustee["person_name"] == "BOB JONES"
|
||||
assert trustee["title"] == "TRUSTEE"
|
||||
assert trustee["reportable_comp_from_org"] == 0
|
||||
|
||||
|
||||
def test_parse_schedule_j(fixtures_dir):
|
||||
root = parse_xml(fixtures_dir / "990_sample.xml")
|
||||
people = parse_schedule_j(root)
|
||||
assert len(people) == 2
|
||||
|
||||
president = people[0]
|
||||
assert president["person_name"] == "JOHN DOE"
|
||||
assert president["base_compensation"] == 700000
|
||||
assert president["bonus_compensation"] == 100000
|
||||
assert president["deferred_compensation"] == 75000
|
||||
assert president["total_compensation"] == 950000
|
||||
|
||||
vp = people[1]
|
||||
assert vp["person_name"] == "JANE SMITH"
|
||||
assert vp["total_compensation"] == 520000
|
||||
Loading…
Add table
Add a link
Reference in a new issue