diff --git a/client/tests/functional/data/test_deleted_file_filewidget.yml b/client/tests/functional/data/test_deleted_file_filewidget.yml new file mode 100644 index 000000000..d21284c47 --- /dev/null +++ b/client/tests/functional/data/test_deleted_file_filewidget.yml @@ -0,0 +1,1242 @@ +interactions: +- request: + body: '{"username": "journalist", "passphrase": "correct horse battery staple + profanity oil chewy", "one_time_code": "918636"}' + headers: {} + method: POST + uri: api/v1/token + response: !!python/object:securedrop_client.sdk.JSONResponse + data: + expiration: '2024-02-29T23:59:28.948390Z' + journalist_first_name: null + journalist_last_name: null + journalist_uuid: c3375c32-955a-435e-b5d4-5737e2ac6d5e + token: ImVQSHpYcUtKa3lya0RxVEpERFF6cGdZdWlUMTRDVUY1RDlib0lyYnh6X2si.ZeD-QA.w0_YrvPSX-gwlLikWg_8DoJbDuU + headers: + connection: close + content-length: '290' + content-type: application/json + date: Thu, 29 Feb 2024 21:59:28 GMT + server: Werkzeug/2.2.3 Python/3.8.10 + status: 200 +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - Token ImVQSHpYcUtKa3lya0RxVEpERFF6cGdZdWlUMTRDVUY1RDlib0lyYnh6X2si.ZeD-QA.w0_YrvPSX-gwlLikWg_8DoJbDuU + Content-Type: + - application/json + method: GET + uri: api/v1/users + response: !!python/object:securedrop_client.sdk.JSONResponse + data: + users: + - first_name: null + last_name: null + username: journalist + uuid: c3375c32-955a-435e-b5d4-5737e2ac6d5e + - first_name: null + last_name: null + username: dellsberg + uuid: 653f977b-f651-4229-a4d8-08806cd99926 + - first_name: null + last_name: null + username: deleted + uuid: 9a2d3d07-1dcd-4fe3-b715-a9ffd583000c + headers: + connection: close + content-length: '474' + content-type: application/json + date: Thu, 29 Feb 2024 21:59:29 GMT + server: Werkzeug/2.2.3 Python/3.8.10 + status: 200 +- request: + body: null + headers: + Accept: + - application/json + Authorization: + - Token ImVQSHpYcUtKa3lya0RxVEpERFF6cGdZdWlUMTRDVUY1RDlib0lyYnh6X2si.ZeD-QA.w0_YrvPSX-gwlLikWg_8DoJbDuU + Content-Type: + - application/json + method: GET + uri: api/v1/sources + response: !!python/object:securedrop_client.sdk.JSONResponse + data: + sources: + - add_star_url: /api/v1/sources/c7482aed-6830-42b4-9fa0-eb393f46d8dc/add_star + interaction_count: 6 + is_flagged: false + is_starred: false + journalist_designation: binomial survivalist + key: + fingerprint: 9DDCE0E92E70C18D8C30224CEF9EF0A4EA9AE066 + public: '-----BEGIN PGP PUBLIC KEY BLOCK----- + + Comment: 9DDC E0E9 2E70 C18D 8C30 224C EF9E F0A4 EA9A E066 + + Comment: Source Key callable: + if isinstance(item, db.File): + return get_file + elif isinstance(item, db.Reply): + return get_reply + else: # db.Message + return get_message + + for item in items: + get_item = get_object(item) + with pytest.raises(SDDatabaseError): + get_item(session, item.uuid) + + def test_mark_pending_replies_as_failed(mocker, session, reply_status_codes): source = factory.Source() pending_status = (