-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #329 from fecgov/release/sprint-50
Release/sprint 50
- Loading branch information
Showing
5 changed files
with
170 additions
and
20 deletions.
There are no files selected for viewing
70 changes: 70 additions & 0 deletions
70
fecfile_validate_python/tests/sample_independent_expenditure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"children": [], | ||
"transaction_id": "123", | ||
"form_type": "SE", | ||
"filer_committee_id_number": "C12345678", | ||
"transaction_type_identifier": "INDEPENDENT_EXPENDITURE_CREDIT_CARD_PAYMENT", | ||
"aggregation_group": "INDEPENDENT_EXPENDITURE", | ||
"schema_name": "INDEPENDENT_EXPENDITURE_PARENTS", | ||
"entity_type": "ORG", | ||
"payee_organization_name": "1", | ||
"payee_street_1": "1", | ||
"payee_street_2": null, | ||
"payee_city": "1", | ||
"payee_state": "AZ", | ||
"payee_zip": "1", | ||
"election_code": "G1234", | ||
"election_other_description": null, | ||
"dissemination_date": "2024-10-01", | ||
"expenditure_amount": 1, | ||
"disbursement_date": null, | ||
"expenditure_purpose_descrip": "Credit Card: See Below", | ||
"category_code": null, | ||
"support_oppose_code": "S", | ||
"so_candidate_id_number": "P01234567", | ||
"so_candidate_last_name": "last", | ||
"so_candidate_first_name": "first", | ||
"so_candidate_middle_name": null, | ||
"so_candidate_prefix": null, | ||
"so_candidate_suffix": null, | ||
"so_candidate_office": "P", | ||
"so_candidate_state": null, | ||
"so_candidate_district": null, | ||
"completing_last_name": "1", | ||
"completing_first_name": "1", | ||
"completing_middle_name": null, | ||
"completing_prefix": null, | ||
"completing_suffix": null, | ||
"date_signed": "2024-10-23", | ||
"memo_code": true, | ||
"organization_name": null, | ||
"street_1": null, | ||
"street_2": null, | ||
"city": null, | ||
"state": null, | ||
"zip": null, | ||
"candidate_fec_id": null, | ||
"candidate_last_name": null, | ||
"candidate_first_name": null, | ||
"candidate_middle_name": null, | ||
"candidate_prefix": null, | ||
"candidate_suffix": null, | ||
"candidate_office": null, | ||
"candidate_state": null, | ||
"candidate_district": null, | ||
"date": null, | ||
"amount": null, | ||
"purpose_description": null, | ||
"text4000": null, | ||
"signatory_1_last_name": null, | ||
"signatory_1_first_name": null, | ||
"signatory_1_middle_name": null, | ||
"signatory_1_prefix": null, | ||
"signatory_1_suffix": null, | ||
"signatory_1_date": null, | ||
"aggregate": null, | ||
"date2": null, | ||
"calendar_ytd": null, | ||
"schedule_id": "E", | ||
"calendar_ytd_per_election_office": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import pytest | ||
import json | ||
import os | ||
from fecfile_validate_python.src.fecfile_validate import validate | ||
|
||
|
||
@pytest.fixture | ||
def sample_ie(): | ||
with open( | ||
os.path.join(os.path.dirname(__file__), "sample_independent_expenditure.json") | ||
) as f: | ||
form_data = json.load(f) | ||
return form_data | ||
|
||
|
||
def test_ie(sample_ie): | ||
validation_result = validate.validate("INDEPENDENT_EXPENDITURE_PARENTS", sample_ie) | ||
# pass if election code is Gxxxx without candidate state | ||
assert validation_result.errors == [] | ||
sample_ie["election_code"] = "P2020" | ||
validation_result = validate.validate("INDEPENDENT_EXPENDITURE_PARENTS", sample_ie) | ||
# faile if election code is Pxxxx without candidate state | ||
assert validation_result.errors[0].path == "so_candidate_state" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters