generated from cfpb/open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report non-processing state check (#309)
Closes #286
- Loading branch information
Showing
3 changed files
with
73 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -967,7 +967,7 @@ async def test_get_latest_sub_report( | |
timestamp=datetime.datetime.now(), | ||
), | ||
filing=1, | ||
state=SubmissionState.VALIDATION_IN_PROGRESS, | ||
state=SubmissionState.VALIDATION_SUCCESSFUL, | ||
validation_ruleset_version="v1", | ||
submission_time=datetime.datetime.now(), | ||
filename="file1.csv", | ||
|
@@ -987,11 +987,32 @@ async def test_get_latest_sub_report( | |
assert res.headers["content-disposition"] == 'attachment; filename="1_validation_report.csv"' | ||
assert res.headers["Cache-Control"] == "no-store" | ||
|
||
sub_mock.return_value = SubmissionDAO( | ||
id=1, | ||
submitter=UserActionDAO( | ||
id=1, | ||
user_id="1234-5678-ABCD-EFGH", | ||
user_name="Test Submitter User", | ||
user_email="[email protected]", | ||
action_type=UserActionType.SUBMIT, | ||
timestamp=datetime.datetime.now(), | ||
), | ||
filing=1, | ||
state=SubmissionState.VALIDATION_IN_PROGRESS, | ||
validation_ruleset_version="v1", | ||
submission_time=datetime.datetime.now(), | ||
filename="file1.csv", | ||
) | ||
|
||
client = TestClient(app_fixture) | ||
res = client.get("/v1/filing/institutions/1234567890ZXWVUTSR00/filings/2024/submissions/latest/report") | ||
assert res.status_code == 404 | ||
|
||
sub_mock.return_value = [] | ||
client = TestClient(app_fixture) | ||
res = client.get("/v1/filing/institutions/1234567890ZXWVUTSR00/filings/2024/submissions/latest/report") | ||
sub_mock.assert_called_with(ANY, "1234567890ZXWVUTSR00", "2024") | ||
assert res.status_code == 204 | ||
assert res.status_code == 404 | ||
|
||
# verify Filing Not Found RegTechHttpException returned when filing does not exist | ||
get_filing_mock.return_value = None | ||
|
@@ -1012,7 +1033,7 @@ async def test_get_sub_report(self, mocker: MockerFixture, app_fixture: FastAPI, | |
timestamp=datetime.datetime.now(), | ||
), | ||
filing=1, | ||
state=SubmissionState.VALIDATION_IN_PROGRESS, | ||
state=SubmissionState.VALIDATION_SUCCESSFUL, | ||
validation_ruleset_version="v1", | ||
submission_time=datetime.datetime.now(), | ||
filename="file1.csv", | ||
|
@@ -1032,6 +1053,27 @@ async def test_get_sub_report(self, mocker: MockerFixture, app_fixture: FastAPI, | |
assert res.headers["content-disposition"] == 'attachment; filename="2_validation_report.csv"' | ||
assert res.headers["Cache-Control"] == "no-store" | ||
|
||
sub_mock.return_value = SubmissionDAO( | ||
id=2, | ||
submitter=UserActionDAO( | ||
id=1, | ||
user_id="1234-5678-ABCD-EFGH", | ||
user_name="Test Submitter User", | ||
user_email="[email protected]", | ||
action_type=UserActionType.SUBMIT, | ||
timestamp=datetime.datetime.now(), | ||
), | ||
filing=1, | ||
state=SubmissionState.VALIDATION_IN_PROGRESS, | ||
validation_ruleset_version="v1", | ||
submission_time=datetime.datetime.now(), | ||
filename="file1.csv", | ||
) | ||
|
||
client = TestClient(app_fixture) | ||
res = client.get("/v1/filing/institutions/1234567890ZXWVUTSR00/filings/2024/submissions/1/report") | ||
assert res.status_code == 404 | ||
|
||
sub_mock.return_value = [] | ||
client = TestClient(app_fixture) | ||
res = client.get("/v1/filing/institutions/1234567890ZXWVUTSR00/filings/2024/submissions/1/report") | ||
|