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.yaml | 62 +++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 27 deletions(-) (limited to 'tests/cassettes/test_notifications.yaml') diff --git a/tests/cassettes/test_notifications.yaml b/tests/cassettes/test_notifications.yaml index 9725dd3..506fd6d 100644 --- a/tests/cassettes/test_notifications.yaml +++ b/tests/cassettes/test_notifications.yaml @@ -20,18 +20,18 @@ interactions: uri: http://localhost:3000/api/v1/statuses response: body: - string: '{"id":"109304275731620250","created_at":"2022-11-07T19:54:47.019Z","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/109304275731620250","url":"http://localhost:3000/@admin/109304275731620250","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":"109336736257964389","created_at":"2022-11-13T13:29:55.343Z","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/109336736257964389","url":"http://localhost:3000/@admin/109336736257964389","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-zSLoC5Q32sk9vIRq+Prp7A==''; + style-src ''self'' http://localhost:3000 ''nonce-9SrmunC9KeECGJSvdPcU0Q==''; 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/"9106a1d344dbbc094a40c28c1cedf3be" + - W/"b0b60afbdd2f3738699df82687d73fea" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -59,13 +59,13 @@ interactions: X-RateLimit-Limit: - '300' X-RateLimit-Remaining: - - '298' + - '279' X-RateLimit-Reset: - - '2022-11-07T21:00:00.050068Z' + - '2022-11-13T15:00:00.367921Z' X-Request-Id: - - 2eeedc8e-4eee-437b-ae62-e6caa7893f8d + - de80dee2-10f1-4324-94b1-aab3d51a6fa8 X-Runtime: - - '0.043624' + - '0.036302' 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":"22","type":"mention","created_at":"2022-11-13T13:29:55.429Z","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":"109336736257964389","created_at":"2022-11-13T13:29:55.343Z","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/109336736257964389","url":"http://localhost:3000/@admin/109336736257964389","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-407BmP7FOO/UsK5b5NNrXA==''; + style-src ''self'' http://localhost:3000 ''nonce-jpZZmA00zFuZOJMkr9ZtIA==''; 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/"e6b6660c8043f215b2ec1d170c6b030d" 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: - - 62c36486-3dc5-45e2-b294-60bc965170c0 + - 1eeab17d-a396-45d7-8d31-e57f6d63163e X-Runtime: - - '0.018882' + - '0.023950' X-XSS-Protection: - 1; mode=block status: @@ -146,17 +150,21 @@ interactions: User-Agent: - tests/v311 method: GET - uri: http://localhost:3000/api/v1/notifications/6 + uri: http://localhost:3000/api/v1/notifications/22 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":"22","type":"mention","created_at":"2022-11-13T13:29:55.429Z","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":"109336736257964389","created_at":"2022-11-13T13:29:55.343Z","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/109336736257964389","url":"http://localhost:3000/@admin/109336736257964389","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-/t5Bi09ywV8jEb7/g6MC7w==''; + style-src ''self'' http://localhost:3000 ''nonce-uQyyBhPt5yylKe2x8iDjBw==''; 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,7 +174,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"58f32e98b742a1193c9167f088f61c2a" + - W/"30ac67fb55fd0cb91209785d6c63e0fc" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -182,9 +190,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 64d03c02-3485-4f18-b9ff-cc54b2a214e8 + - 7e53aa84-d48d-4e41-9c92-7df90321ed6f X-Runtime: - - '0.013038' + - '0.020495' X-XSS-Protection: - 1; mode=block status: @@ -206,19 +214,19 @@ interactions: User-Agent: - tests/v311 method: DELETE - uri: http://localhost:3000/api/v1/statuses/109304275731620250 + uri: http://localhost:3000/api/v1/statuses/109336736257964389 response: body: - string: '{"id":"109304275731620250","created_at":"2022-11-07T19:54:47.019Z","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/109304275731620250","url":"http://localhost:3000/@admin/109304275731620250","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":"109336736257964389","created_at":"2022-11-13T13:29:55.343Z","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/109336736257964389","url":"http://localhost:3000/@admin/109336736257964389","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-A3h5y1V++macRJqI7vMKEA==''; + style-src ''self'' http://localhost:3000 ''nonce-nTiaj5OIzFOdKZer99TZag==''; 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 @@ -228,7 +236,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"bb4f63c62b4f64e26a13822164a8e320" + - W/"a0f7ed33c9e8532ecce59c00b14d6ef2" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -244,9 +252,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 88396cc6-80a4-4007-a18e-edd5f44c8e61 + - eef84a5c-cc02-4144-a2ee-b8c96d77d097 X-Runtime: - - '0.028626' + - '0.024639' X-XSS-Protection: - 1; mode=block status: -- cgit v1.2.3