This repository has been archived by the owner on Jul 25, 2024. It is now read-only.
generated from communitiesuk/funding-service-design-TEMPLATE
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #119 from communitiesuk/FPASF-143-fix-download-report
FPASF-143: fix download report
- Loading branch information
Showing
3 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import pytest | ||
|
||
|
||
@pytest.mark.usefixtures("mock_get_response_xlsx") | ||
def test_download_logging(flask_test_client, caplog): | ||
flask_test_client.post("/download", data={"file_format": "xlsx"}) | ||
log_line = [record for record in caplog.records if hasattr(record, "request_type")] | ||
assert len(log_line) == 1 | ||
assert log_line[0].request_type == "download" | ||
assert log_line[0].user_id == "test-user" | ||
assert log_line[0].query_params == {"file_format": "xlsx"} |