From b1e1ec7bdc9e84ecd31626f1a4fbf645e84d0bb2 Mon Sep 17 00:00:00 2001 From: halcy Date: Sun, 13 Nov 2022 15:33:10 +0200 Subject: Add support for timed mutes, fix tests to actually pass with new setup --- tests/cassettes/test_notifications_dismiss.yaml | 66 +++++++++++++------------ 1 file changed, 35 insertions(+), 31 deletions(-) (limited to 'tests/cassettes/test_notifications_dismiss.yaml') diff --git a/tests/cassettes/test_notifications_dismiss.yaml b/tests/cassettes/test_notifications_dismiss.yaml index 0d597af..cce0e14 100644 --- a/tests/cassettes/test_notifications_dismiss.yaml +++ b/tests/cassettes/test_notifications_dismiss.yaml @@ -20,18 +20,18 @@ interactions: uri: http://localhost:3000/api/v1/statuses response: body: - string: '{"id":"109304275739881636","created_at":"2022-11-07T19:54:47.146Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/109304275739881636","url":"http://localhost:3000/@admin/109304275739881636","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003e\u003cspan + string: '{"id":"109336736463234442","created_at":"2022-11-13T13:29:58.475Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/109336736463234442","url":"http://localhost:3000/@admin/109336736463234442","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003e\u003cspan class=\"h-card\"\u003e\u003ca href=\"http://localhost:3000/@mastodonpy_test\" class=\"u-url mention\"\u003e@\u003cspan\u003emastodonpy_test\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e hello!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py - test suite","website":null},"account":{"id":"109304268902557892","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-07T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"last_status_at":"2022-11-07","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"1234567890123456","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}' + test suite","website":null},"account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":4,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109336623311102204","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}' headers: Cache-Control: - no-store Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-Ood1uft1M+AF/X5YjwwWYQ==''; + style-src ''self'' http://localhost:3000 ''nonce-Kdm48rcOMTp/2a/sjRUHpg==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -41,7 +41,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"c85dbe58cf9dfbbaa5df16dc6606153b" + - W/"b3622f65afe74dd08cc60266bb724b58" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -59,13 +59,13 @@ interactions: X-RateLimit-Limit: - '300' X-RateLimit-Remaining: - - '297' + - '278' X-RateLimit-Reset: - - '2022-11-07T21:00:00.172285Z' + - '2022-11-13T15:00:00.499745Z' X-Request-Id: - - 0f21f001-b16a-47a6-bbc0-f81e61bf28ed + - aeb82125-6216-4444-8f52-ed73a594863f X-Runtime: - - '0.039049' + - '0.035988' X-XSS-Protection: - 1; mode=block status: @@ -88,14 +88,18 @@ interactions: uri: http://localhost:3000/api/v1/notifications response: body: - string: '[{"id":"6","type":"follow_request","created_at":"2022-11-07T19:54:38.477Z","account":{"id":"109304268902557892","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-07T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"last_status_at":"2022-11-07","noindex":false,"emojis":[],"fields":[]}}]' + string: '[{"id":"23","type":"mention","created_at":"2022-11-13T13:29:58.565Z","account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":4,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"status":{"id":"109336736463234442","created_at":"2022-11-13T13:29:58.475Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/109336736463234442","url":"http://localhost:3000/@admin/109336736463234442","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"\u003cp\u003e\u003cspan + class=\"h-card\"\u003e\u003ca href=\"http://localhost:3000/@mastodonpy_test\" + class=\"u-url mention\"\u003e@\u003cspan\u003emastodonpy_test\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e + hello!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":4,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109336623311102204","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}}]' headers: Cache-Control: - no-store Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-GLe/BRxMb/4ukIpP+ySz6w==''; + style-src ''self'' http://localhost:3000 ''nonce-iN4nrD8+cXV7iqdEWIjA5Q==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -105,9 +109,9 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"7ba0277d54c9ec55fa8e206c94e7e7c5" + - W/"4baf58dd76c97345b3da7b267f6c0531" Link: - - ; rel="next", ; + - ; rel="next", ; rel="prev" Referrer-Policy: - strict-origin-when-cross-origin @@ -124,9 +128,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 74be2b71-76f2-4f2c-8817-7f45a17bd654 + - e1c891cf-2025-4f96-b0e8-ba78492ef13d X-Runtime: - - '0.019147' + - '0.023606' X-XSS-Protection: - 1; mode=block status: @@ -149,14 +153,14 @@ interactions: uri: http://localhost:3000/api/v1/instance/ response: body: - string: '{"uri":"localhost:3000","title":"Mastodon","short_description":"","description":"","email":"","version":"4.0.0rc1","urls":{"streaming_api":"ws://localhost:4000"},"stats":{"user_count":4,"status_count":1,"domain_count":0},"thumbnail":"http://localhost:3000/packs/media/images/preview-6399aebd96ccf025654e2977454f168f.png","languages":["en"],"registrations":true,"approval_required":false,"invites_enabled":true,"configuration":{"accounts":{"max_featured_tags":10},"statuses":{"max_characters":500,"max_media_attachments":4,"characters_reserved_per_url":23},"media_attachments":{"supported_mime_types":["image/jpeg","image/png","image/gif","image/heic","image/heif","image/webp","image/avif","video/webm","video/mp4","video/quicktime","video/ogg","audio/wave","audio/wav","audio/x-wav","audio/x-pn-wave","audio/vnd.wave","audio/ogg","audio/vorbis","audio/mpeg","audio/mp3","audio/webm","audio/flac","audio/aac","audio/m4a","audio/x-m4a","audio/mp4","audio/3gpp","video/x-ms-asf"],"image_size_limit":10485760,"image_matrix_limit":16777216,"video_size_limit":41943040,"video_frame_rate_limit":60,"video_matrix_limit":2304000},"polls":{"max_options":4,"max_characters_per_option":50,"min_expiration":300,"max_expiration":2629746}},"contact_account":null,"rules":[]}' + string: '{"uri":"localhost:3000","title":"Mastodon","short_description":"","description":"","email":"","version":"4.0.0rc2","urls":{"streaming_api":"ws://localhost:4000"},"stats":{"user_count":4,"status_count":7,"domain_count":0},"thumbnail":"http://localhost:3000/packs/media/images/preview-6399aebd96ccf025654e2977454f168f.png","languages":["en"],"registrations":true,"approval_required":false,"invites_enabled":true,"configuration":{"accounts":{"max_featured_tags":10},"statuses":{"max_characters":500,"max_media_attachments":4,"characters_reserved_per_url":23},"media_attachments":{"supported_mime_types":["image/jpeg","image/png","image/gif","image/heic","image/heif","image/webp","image/avif","video/webm","video/mp4","video/quicktime","video/ogg","audio/wave","audio/wav","audio/x-wav","audio/x-pn-wave","audio/vnd.wave","audio/ogg","audio/vorbis","audio/mpeg","audio/mp3","audio/webm","audio/flac","audio/aac","audio/m4a","audio/x-m4a","audio/mp4","audio/3gpp","video/x-ms-asf"],"image_size_limit":10485760,"image_matrix_limit":16777216,"video_size_limit":41943040,"video_frame_rate_limit":60,"video_matrix_limit":2304000},"polls":{"max_options":4,"max_characters_per_option":50,"min_expiration":300,"max_expiration":2629746}},"contact_account":null,"rules":[]}' headers: Cache-Control: - max-age=180, public Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-YW16mj5VvnRtGyT5WYZLVg==''; + style-src ''self'' http://localhost:3000 ''nonce-f93HYmWNljV8fRYo1wH3kg==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -166,9 +170,9 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Mon, 07 Nov 2022 19:54:47 GMT + - Sun, 13 Nov 2022 13:30:01 GMT ETag: - - W/"a17de89b698f0c42f267e69340e11e47" + - W/"6c14ac0d07842aa42335cbaf2881fd8d" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -184,9 +188,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 38ffba67-56c0-4b67-a214-28bc43f86639 + - 24416733-be43-4561-b6bb-523739e7652d X-Runtime: - - '0.013739' + - '0.012009' X-XSS-Protection: - 1; mode=block status: @@ -208,7 +212,7 @@ interactions: User-Agent: - tests/v311 method: POST - uri: http://localhost:3000/api/v1/notifications/6/dismiss + uri: http://localhost:3000/api/v1/notifications/23/dismiss response: body: string: '{}' @@ -218,7 +222,7 @@ interactions: Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-S8/BS4+NES5M1jWFmsp4ng==''; + style-src ''self'' http://localhost:3000 ''nonce-DG3HkoQV1nrR3r7RuvVETA==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -244,9 +248,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 4b947742-ab8d-40c1-9b93-261fec9ea293 + - 6be177ab-65ee-4a9b-95d3-759d67b3e7ce X-Runtime: - - '0.010901' + - '0.018239' X-XSS-Protection: - 1; mode=block status: @@ -268,19 +272,19 @@ interactions: User-Agent: - tests/v311 method: DELETE - uri: http://localhost:3000/api/v1/statuses/109304275739881636 + uri: http://localhost:3000/api/v1/statuses/109336736463234442 response: body: - string: '{"id":"109304275739881636","created_at":"2022-11-07T19:54:47.146Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/109304275739881636","url":"http://localhost:3000/@admin/109304275739881636","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"@mastodonpy_test + string: '{"id":"109336736463234442","created_at":"2022-11-13T13:29:58.475Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/109336736463234442","url":"http://localhost:3000/@admin/109336736463234442","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"@mastodonpy_test hello!","filtered":[],"reblog":null,"application":{"name":"Mastodon.py test - suite","website":null},"account":{"id":"109304268902557892","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-07T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":"2022-11-07","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"1234567890123456","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}' + suite","website":null},"account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":3,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109336623311102204","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}' headers: Cache-Control: - no-store Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-fbFVsvr3bIsp3OAMiUkOCQ==''; + style-src ''self'' http://localhost:3000 ''nonce-expF3hORWgVjCjoe6u2WCA==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -290,7 +294,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"96a5f537070048a9fbca4202992a5561" + - W/"aca2dde40239b50d949f3c4522d9ca5c" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -306,9 +310,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 09253804-3f84-4bd6-a5da-44efa042f938 + - 60ea9d84-1e9e-4696-a905-2a42035307c6 X-Runtime: - - '0.027164' + - '0.024171' X-XSS-Protection: - 1; mode=block status: -- cgit v1.2.3