M18: implement operational workspaces
This commit is contained in:
@@ -53,6 +53,49 @@ def test_list_issues_requires_operations_manager(employee_client):
|
||||
assert response.status_code == 403
|
||||
|
||||
|
||||
def test_manager_can_assign_prioritised_quality_work_and_filter_it(ops_client):
|
||||
assignee = next(user for user in ops_client.get("/api/v1/users").json() if user["active"])
|
||||
open_issues = ops_client.get("/api/v1/data-quality/issues", params={"status": "open"}).json()
|
||||
refs = [issue["public_ref"] for issue in open_issues[:2]]
|
||||
due_at = "2030-01-15T12:00:00+00:00"
|
||||
updated = ops_client.post(
|
||||
"/api/v1/data-quality/issues/bulk-work",
|
||||
json={
|
||||
"issue_refs": refs,
|
||||
"assigned_to_ref": assignee["public_ref"],
|
||||
"due_at": due_at,
|
||||
},
|
||||
)
|
||||
assert updated.status_code == 200
|
||||
assert {issue["public_ref"] for issue in updated.json()["updated"]} == set(refs)
|
||||
assert all(
|
||||
issue["assigned_to_ref"] == assignee["public_ref"] for issue in updated.json()["updated"]
|
||||
)
|
||||
|
||||
filtered = ops_client.get(
|
||||
"/api/v1/data-quality/issues",
|
||||
params={"status": "open", "assigned_to_ref": assignee["public_ref"]},
|
||||
).json()
|
||||
assert set(refs).issubset({issue["public_ref"] for issue in filtered})
|
||||
audits = ops_client.get("/api/v1/audit", params={"action": "data_quality_work_updated"}).json()
|
||||
assert len(audits) >= 2
|
||||
|
||||
cleared = ops_client.post(
|
||||
"/api/v1/data-quality/issues/bulk-work",
|
||||
json={"issue_refs": refs, "clear_assignment": True},
|
||||
)
|
||||
assert cleared.status_code == 200
|
||||
assert all(issue["assigned_to_ref"] is None for issue in cleared.json()["updated"])
|
||||
|
||||
|
||||
def test_employee_cannot_assign_quality_work(employee_client):
|
||||
response = employee_client.post(
|
||||
"/api/v1/data-quality/issues/bulk-work",
|
||||
json={"issue_refs": ["DQ-DEMO-OVERLAP"], "clear_assignment": True},
|
||||
)
|
||||
assert response.status_code == 403
|
||||
|
||||
|
||||
def test_issue_page_preserves_severity_filter_and_limits_results(ops_client):
|
||||
response = ops_client.get(
|
||||
"/api/v1/data-quality/issues",
|
||||
|
||||
Reference in New Issue
Block a user