diff --git a/tests/test_api_smoke.py b/tests/test_api_smoke.py index 09bbfa2..4939803 100644 --- a/tests/test_api_smoke.py +++ b/tests/test_api_smoke.py @@ -3743,7 +3743,8 @@ class ApiSmokeTests(unittest.TestCase): def test_non_blocking_review_conditions_can_be_accepted_in_bulk(self) -> None: - headers, _ = self._login() + headers, login = self._login() + user_id = login["user"]["id"] campaign_json = { "version": "1.0", "campaign": {"id": "bulk-review", "name": "Bulk review", "mode": "test"}, @@ -3751,10 +3752,25 @@ class ApiSmokeTests(unittest.TestCase): "server": {"smtp": {"host": "smtp.example.invalid", "port": 587, "security": "starttls"}}, "recipients": {"from": {"email": "sender@example.org", "type": "to"}, "allow_individual_to": True}, "template": {"subject": "Warning test", "text": "Body"}, - "attachments": {"base_path": ".", "base_paths": [], "global": [{ - "id": "optional-missing", "base_dir": ".", "file_filter": "not-there.pdf", - "required": False, "missing_behavior": "warn", "zip": {"archive_id": "exclude"} - }], "zip": {"enabled": False, "archives": []}}, + "attachments": { + "base_path": "review-files", + "base_paths": [{ + "id": "managed-review-files", + "name": "Review files", + "source": f"managed:user:{user_id}", + "path": "review-files", + }], + "global": [{ + "id": "optional-missing", + "base_path_id": "managed-review-files", + "base_dir": "review-files", + "file_filter": "not-there.pdf", + "required": False, + "missing_behavior": "warn", + "zip": {"archive_id": "exclude"}, + }], + "zip": {"enabled": False, "archives": []}, + }, "entries": {"inline": [{"id": "warning-entry", "to": [{"email": "recipient@example.org", "type": "to"}]}]}, "validation_policy": {"missing_email": "block", "template_error": "block", "missing_optional_attachment": "warn"}, "delivery": {"imap_append_sent": {"enabled": False}}, "status_tracking": {"enabled": True}, @@ -3779,7 +3795,8 @@ class ApiSmokeTests(unittest.TestCase): self.assertEqual(review_state["reviewed_message_keys"], ["warning-entry"]) def test_inactive_recipients_are_aggregated_but_not_built_or_reviewed(self) -> None: - headers, _ = self._login() + headers, login = self._login() + user_id = login["user"]["id"] campaign_json = { "version": "1.0", "campaign": {"id": "inactive-recipients", "name": "Inactive recipients", "mode": "test"}, @@ -3788,10 +3805,30 @@ class ApiSmokeTests(unittest.TestCase): "server": {"smtp": {"host": "smtp.example.invalid", "port": 587, "security": "starttls"}}, "recipients": {"from": {"email": "sender@example.org", "name": "Sender", "type": "to"}, "allow_individual_to": True}, "template": {"subject": "Hello", "text": "Active recipient only"}, - "attachments": {"base_path": ".", "base_paths": [], "global": [], "zip": {"enabled": False, "archives": []}}, + "attachments": { + "base_path": "inactive-files", + "base_paths": [{ + "id": "managed-inactive-files", + "name": "Inactive files", + "source": f"managed:user:{user_id}", + "path": "inactive-files", + }], + "global": [], + "zip": {"enabled": False, "archives": []}, + }, "entries": {"inline": [ {"id": "active", "active": True, "to": [{"email": "active@example.org", "type": "to"}]}, - {"id": "inactive", "active": False, "to": [], "attachments": [{"base_dir": "missing", "file_filter": "missing.pdf", "required": True}]}, + { + "id": "inactive", + "active": False, + "to": [], + "attachments": [{ + "base_path_id": "managed-inactive-files", + "base_dir": "inactive-files", + "file_filter": "missing.pdf", + "required": True, + }], + }, ]}, "validation_policy": {"missing_email": "block", "template_error": "block", "missing_required_attachment": "block"}, "delivery": {"imap_append_sent": {"enabled": False}},