-
Notifications
You must be signed in to change notification settings - Fork 16
Adds AuditLog and ExecutionLogs to seed_test_data command
#1097
Conversation
seed_test_data commandAuditLog and ExecutionLogs to seed_test_data command
scripts/create_test_data.py
Outdated
| "message": f"Execution log for request id {pr.id} status {status} and action_type {action_type}", | ||
| }, | ||
| ) | ||
| # run_privacy_request.apply(args=[pr.id]) # Run the request synchronously |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out code
scripts/create_test_data.py
Outdated
| data={ | ||
| "dataset_name": "dummy_dataset", | ||
| "collection_name": "dummy_collection", | ||
| "fields_affected": ["dummy_field_1", "dummy_field_2"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't the correct format for fields_affected - it looks more like:
[{
"path": "dataset_name:collection_name:field_name",
"field_name": "field_name",
"data_categories": ["data_category_1", "data_category_2"]
}]
| AuditLogAction.approved, | ||
| AuditLogAction.denied, | ||
| AuditLogAction.finished, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know this is dummy data, but maybe switching the order of approved and denied might be useful, so in a demo it doesn't look like it was denied and then it finished
pattisdr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good improvement to our test data!
| "path": "dummy_dataset:dummy_collection:dummy_field_1", | ||
| "field_name": "dummy_field", | ||
| "data_categories": [ | ||
| "data_category_1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a fine for now, but at some point we may be using this data and have validation where Pydantic expects them to be proper data categories.
Purpose
This PR adds test
AuditLogandExecutionLogdata to theseed_test_datacommand.Changes
AuditLogandExecutionLogs for createdPrivacyRequestobjects of every permutation of action and status.Checklist
CHANGELOG.mdfileCHANGELOG.mdfile is being appended toUnreleasedsection in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.Run Unsafe PR Checkslabel has been applied, and checks have passed, if this PR touches any external services