From f862650b732548c550e240c6a2106c6ad7b53765 Mon Sep 17 00:00:00 2001 From: halcy Date: Sun, 27 Nov 2022 02:53:42 +0200 Subject: Fix test by using fixed dates --- tests/cassettes/test_admin_stats.yaml | 42 +++++++++++++++++------------------ tests/test_admin.py | 16 ++++++------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tests/cassettes/test_admin_stats.yaml b/tests/cassettes/test_admin_stats.yaml index dc88b9b..6a72c83 100644 --- a/tests/cassettes/test_admin_stats.yaml +++ b/tests/cassettes/test_admin_stats.yaml @@ -6,7 +6,7 @@ interactions: {"domain": "chitter.xyz"}, "keys": ["active_users", "new_users", "opened_reports", "resolved_reports", "instance_accounts", "instance_media_attachments", "instance_reports", "instance_statuses", "instance_follows", "instance_followers"], "start_at": - "2022-11-22T00:42:51+00:00", "end_at": "2022-11-27T00:42:51+00:00"}' + "2020-10-04T21:00:00+00:00", "end_at": "2020-10-09T21:00:00+00:00"}' headers: Accept: - '*/*' @@ -26,15 +26,15 @@ interactions: uri: http://localhost:3000/api/v1/admin/measures response: body: - string: '[{"key":"active_users","unit":null,"total":"2","previous_total":"0","data":[{"date":"2022-11-22T00:00:00Z","value":"0"},{"date":"2022-11-23T00:00:00Z","value":"0"},{"date":"2022-11-24T00:00:00Z","value":"0"},{"date":"2022-11-25T00:00:00Z","value":"0"},{"date":"2022-11-26T00:00:00Z","value":"2"}]},{"key":"new_users","unit":null,"total":"4","previous_total":"0","data":[{"date":"2022-11-22T00:00:00.000+00:00","value":"0"},{"date":"2022-11-23T00:00:00.000+00:00","value":"0"},{"date":"2022-11-24T00:00:00.000+00:00","value":"0"},{"date":"2022-11-25T00:00:00.000+00:00","value":"0"},{"date":"2022-11-26T00:00:00.000+00:00","value":"4"},{"date":"2022-11-27T00:00:00.000+00:00","value":"0"}]},{"key":"opened_reports","unit":null,"total":"0","previous_total":"0","data":[{"date":"2022-11-22T00:00:00.000+00:00","value":"0"},{"date":"2022-11-23T00:00:00.000+00:00","value":"0"},{"date":"2022-11-24T00:00:00.000+00:00","value":"0"},{"date":"2022-11-25T00:00:00.000+00:00","value":"0"},{"date":"2022-11-26T00:00:00.000+00:00","value":"0"},{"date":"2022-11-27T00:00:00.000+00:00","value":"0"}]},{"key":"resolved_reports","unit":null,"total":"0","previous_total":"0","data":[{"date":"2022-11-22T00:00:00.000+00:00","value":"0"},{"date":"2022-11-23T00:00:00.000+00:00","value":"0"},{"date":"2022-11-24T00:00:00.000+00:00","value":"0"},{"date":"2022-11-25T00:00:00.000+00:00","value":"0"},{"date":"2022-11-26T00:00:00.000+00:00","value":"0"},{"date":"2022-11-27T00:00:00.000+00:00","value":"0"}]},{"key":"instance_accounts","unit":null,"total":"0","data":[{"date":"2022-11-22T00:00:00.000+00:00","value":"0"},{"date":"2022-11-23T00:00:00.000+00:00","value":"0"},{"date":"2022-11-24T00:00:00.000+00:00","value":"0"},{"date":"2022-11-25T00:00:00.000+00:00","value":"0"},{"date":"2022-11-26T00:00:00.000+00:00","value":"0"},{"date":"2022-11-27T00:00:00.000+00:00","value":"0"}]},{"key":"instance_media_attachments","unit":"bytes","total":"0","human_value":"0 - Bytes","data":[{"date":"2022-11-22T00:00:00.000+00:00","value":""},{"date":"2022-11-23T00:00:00.000+00:00","value":""},{"date":"2022-11-24T00:00:00.000+00:00","value":""},{"date":"2022-11-25T00:00:00.000+00:00","value":""},{"date":"2022-11-26T00:00:00.000+00:00","value":""},{"date":"2022-11-27T00:00:00.000+00:00","value":""}]},{"key":"instance_reports","unit":null,"total":"0","data":[{"date":"2022-11-22T00:00:00.000+00:00","value":"0"},{"date":"2022-11-23T00:00:00.000+00:00","value":"0"},{"date":"2022-11-24T00:00:00.000+00:00","value":"0"},{"date":"2022-11-25T00:00:00.000+00:00","value":"0"},{"date":"2022-11-26T00:00:00.000+00:00","value":"0"},{"date":"2022-11-27T00:00:00.000+00:00","value":"0"}]},{"key":"instance_statuses","unit":null,"total":"0","data":[{"date":"2022-11-22T00:00:00.000+00:00","value":"0"},{"date":"2022-11-23T00:00:00.000+00:00","value":"0"},{"date":"2022-11-24T00:00:00.000+00:00","value":"0"},{"date":"2022-11-25T00:00:00.000+00:00","value":"0"},{"date":"2022-11-26T00:00:00.000+00:00","value":"0"},{"date":"2022-11-27T00:00:00.000+00:00","value":"0"}]},{"key":"instance_follows","unit":null,"total":"0","data":[{"date":"2022-11-22T00:00:00.000+00:00","value":"0"},{"date":"2022-11-23T00:00:00.000+00:00","value":"0"},{"date":"2022-11-24T00:00:00.000+00:00","value":"0"},{"date":"2022-11-25T00:00:00.000+00:00","value":"0"},{"date":"2022-11-26T00:00:00.000+00:00","value":"0"},{"date":"2022-11-27T00:00:00.000+00:00","value":"0"}]},{"key":"instance_followers","unit":null,"total":"0","data":[{"date":"2022-11-22T00:00:00.000+00:00","value":"0"},{"date":"2022-11-23T00:00:00.000+00:00","value":"0"},{"date":"2022-11-24T00:00:00.000+00:00","value":"0"},{"date":"2022-11-25T00:00:00.000+00:00","value":"0"},{"date":"2022-11-26T00:00:00.000+00:00","value":"0"},{"date":"2022-11-27T00:00:00.000+00:00","value":"0"}]}]' + string: '[{"key":"active_users","unit":null,"total":"0","previous_total":"0","data":[{"date":"2020-10-04T00:00:00Z","value":"0"},{"date":"2020-10-05T00:00:00Z","value":"0"},{"date":"2020-10-06T00:00:00Z","value":"0"},{"date":"2020-10-07T00:00:00Z","value":"0"},{"date":"2020-10-08T00:00:00Z","value":"0"}]},{"key":"new_users","unit":null,"total":"0","previous_total":"0","data":[{"date":"2020-10-04T00:00:00.000+00:00","value":"0"},{"date":"2020-10-05T00:00:00.000+00:00","value":"0"},{"date":"2020-10-06T00:00:00.000+00:00","value":"0"},{"date":"2020-10-07T00:00:00.000+00:00","value":"0"},{"date":"2020-10-08T00:00:00.000+00:00","value":"0"},{"date":"2020-10-09T00:00:00.000+00:00","value":"0"}]},{"key":"opened_reports","unit":null,"total":"0","previous_total":"0","data":[{"date":"2020-10-04T00:00:00.000+00:00","value":"0"},{"date":"2020-10-05T00:00:00.000+00:00","value":"0"},{"date":"2020-10-06T00:00:00.000+00:00","value":"0"},{"date":"2020-10-07T00:00:00.000+00:00","value":"0"},{"date":"2020-10-08T00:00:00.000+00:00","value":"0"},{"date":"2020-10-09T00:00:00.000+00:00","value":"0"}]},{"key":"resolved_reports","unit":null,"total":"0","previous_total":"0","data":[{"date":"2020-10-04T00:00:00.000+00:00","value":"0"},{"date":"2020-10-05T00:00:00.000+00:00","value":"0"},{"date":"2020-10-06T00:00:00.000+00:00","value":"0"},{"date":"2020-10-07T00:00:00.000+00:00","value":"0"},{"date":"2020-10-08T00:00:00.000+00:00","value":"0"},{"date":"2020-10-09T00:00:00.000+00:00","value":"0"}]},{"key":"instance_accounts","unit":null,"total":"0","data":[{"date":"2020-10-04T00:00:00.000+00:00","value":"0"},{"date":"2020-10-05T00:00:00.000+00:00","value":"0"},{"date":"2020-10-06T00:00:00.000+00:00","value":"0"},{"date":"2020-10-07T00:00:00.000+00:00","value":"0"},{"date":"2020-10-08T00:00:00.000+00:00","value":"0"},{"date":"2020-10-09T00:00:00.000+00:00","value":"0"}]},{"key":"instance_media_attachments","unit":"bytes","total":"0","human_value":"0 + Bytes","data":[{"date":"2020-10-04T00:00:00.000+00:00","value":""},{"date":"2020-10-05T00:00:00.000+00:00","value":""},{"date":"2020-10-06T00:00:00.000+00:00","value":""},{"date":"2020-10-07T00:00:00.000+00:00","value":""},{"date":"2020-10-08T00:00:00.000+00:00","value":""},{"date":"2020-10-09T00:00:00.000+00:00","value":""}]},{"key":"instance_reports","unit":null,"total":"0","data":[{"date":"2020-10-04T00:00:00.000+00:00","value":"0"},{"date":"2020-10-05T00:00:00.000+00:00","value":"0"},{"date":"2020-10-06T00:00:00.000+00:00","value":"0"},{"date":"2020-10-07T00:00:00.000+00:00","value":"0"},{"date":"2020-10-08T00:00:00.000+00:00","value":"0"},{"date":"2020-10-09T00:00:00.000+00:00","value":"0"}]},{"key":"instance_statuses","unit":null,"total":"0","data":[{"date":"2020-10-04T00:00:00.000+00:00","value":"0"},{"date":"2020-10-05T00:00:00.000+00:00","value":"0"},{"date":"2020-10-06T00:00:00.000+00:00","value":"0"},{"date":"2020-10-07T00:00:00.000+00:00","value":"0"},{"date":"2020-10-08T00:00:00.000+00:00","value":"0"},{"date":"2020-10-09T00:00:00.000+00:00","value":"0"}]},{"key":"instance_follows","unit":null,"total":"0","data":[{"date":"2020-10-04T00:00:00.000+00:00","value":"0"},{"date":"2020-10-05T00:00:00.000+00:00","value":"0"},{"date":"2020-10-06T00:00:00.000+00:00","value":"0"},{"date":"2020-10-07T00:00:00.000+00:00","value":"0"},{"date":"2020-10-08T00:00:00.000+00:00","value":"0"},{"date":"2020-10-09T00:00:00.000+00:00","value":"0"}]},{"key":"instance_followers","unit":null,"total":"0","data":[{"date":"2020-10-04T00:00:00.000+00:00","value":"0"},{"date":"2020-10-05T00:00:00.000+00:00","value":"0"},{"date":"2020-10-06T00:00:00.000+00:00","value":"0"},{"date":"2020-10-07T00:00:00.000+00:00","value":"0"},{"date":"2020-10-08T00:00:00.000+00:00","value":"0"},{"date":"2020-10-09T00:00:00.000+00:00","value":"0"}]}]' 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-drS6KPeE5pwtqRFGPVh3ww==''; + style-src ''self'' http://localhost:3000 ''nonce-WiDzKVOhti4HVtIse/Oj6w==''; 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 @@ -44,7 +44,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"bb40e02b66cfdf5be1ff5a980c8242af" + - W/"7a14cdc98ebdc4f4ee6517f7b12be48b" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -60,9 +60,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 11b2cb9c-d3c4-41ba-802d-888e1ee62c9e + - 07db387f-9f34-4f15-8635-21a9850d96b3 X-Runtime: - - '0.540102' + - '0.082628' X-XSS-Protection: - 1; mode=block status: @@ -71,8 +71,8 @@ interactions: - request: body: '{"instance_accounts": {"domain": "chitter.xyz"}, "instance_languages": {"domain": "chitter.xyz"}, "keys": ["languages", "sources", "servers", "space_usage", - "instance_accounts", "instance_languages"], "limit": 3, "start_at": "2022-11-22T00:42:52+00:00", - "end_at": "2022-11-27T00:42:52+00:00"}' + "instance_accounts", "instance_languages"], "limit": 3, "start_at": "2020-10-04T21:00:00+00:00", + "end_at": "2020-10-09T21:00:00+00:00"}' headers: Accept: - '*/*' @@ -92,8 +92,8 @@ interactions: uri: http://localhost:3000/api/v1/admin/dimensions response: body: - string: '[{"key":"languages","data":[{"key":"de","human_key":"German","value":"1"}]},{"key":"sources","data":[{"key":"web","human_key":"Website","value":"4"}]},{"key":"servers","data":[]},{"key":"space_usage","data":[{"key":"postgresql","human_key":"PostgreSQL","value":"16610095","unit":"bytes","human_value":"15.8 - MB"},{"key":"redis","human_key":"Redis","value":"1560216","unit":"bytes","human_value":"1.49 + string: '[{"key":"languages","data":[]},{"key":"sources","data":[]},{"key":"servers","data":[]},{"key":"space_usage","data":[{"key":"postgresql","human_key":"PostgreSQL","value":"16610095","unit":"bytes","human_value":"15.8 + MB"},{"key":"redis","human_key":"Redis","value":"1569560","unit":"bytes","human_value":"1.5 MB"},{"key":"media","human_key":"Media storage","value":"0","unit":"bytes","human_value":"0 Bytes"}]},{"key":"instance_accounts","data":[]},{"key":"instance_languages","data":[]}]' headers: @@ -102,7 +102,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-tTPpzIcGAZb7y2EXyfEsFg==''; + style-src ''self'' http://localhost:3000 ''nonce-8BlKJ/uomeClHGm07flBKg==''; 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 @@ -112,7 +112,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"b5c3e0d37fd2fdab9859f566f5b2fa2e" + - W/"2d84840d6cd38577ff002ff961df6a42" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -128,16 +128,16 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 7332d9ca-00cb-4eaf-9d95-ee3baf8414f9 + - 3837d91b-a8b1-4fb9-a04b-2e85c1d70cd6 X-Runtime: - - '0.066790' + - '0.029226' X-XSS-Protection: - 1; mode=block status: code: 200 message: OK - request: - body: start_at=2022-11-17T00%3A42%3A52%2B00%3A00&end_at=2022-11-27T00%3A42%3A52%2B00%3A00&frequency=day + body: start_at=2020-09-29T21%3A00%3A00%2B00%3A00&end_at=2020-10-09T21%3A00%3A00%2B00%3A00&frequency=day headers: Accept: - '*/*' @@ -157,14 +157,14 @@ interactions: uri: http://localhost:3000/api/v1/admin/retention response: body: - string: '[{"period":"2022-11-17T00:00:00+00:00","frequency":"day","data":[{"date":"2022-11-17T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-18T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-19T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-20T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-21T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-22T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-23T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-24T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-25T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-26T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-27T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2022-11-18T00:00:00+00:00","frequency":"day","data":[{"date":"2022-11-18T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-19T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-20T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-21T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-22T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-23T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-24T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-25T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-26T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-27T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2022-11-19T00:00:00+00:00","frequency":"day","data":[{"date":"2022-11-19T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-20T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-21T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-22T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-23T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-24T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-25T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-26T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-27T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2022-11-20T00:00:00+00:00","frequency":"day","data":[{"date":"2022-11-20T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-21T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-22T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-23T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-24T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-25T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-26T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-27T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2022-11-21T00:00:00+00:00","frequency":"day","data":[{"date":"2022-11-21T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-22T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-23T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-24T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-25T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-26T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-27T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2022-11-22T00:00:00+00:00","frequency":"day","data":[{"date":"2022-11-22T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-23T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-24T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-25T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-26T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-27T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2022-11-23T00:00:00+00:00","frequency":"day","data":[{"date":"2022-11-23T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-24T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-25T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-26T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-27T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2022-11-24T00:00:00+00:00","frequency":"day","data":[{"date":"2022-11-24T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-25T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-26T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-27T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2022-11-25T00:00:00+00:00","frequency":"day","data":[{"date":"2022-11-25T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-26T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2022-11-27T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2022-11-26T00:00:00+00:00","frequency":"day","data":[{"date":"2022-11-26T00:00:00+00:00","rate":0.5,"value":"2"},{"date":"2022-11-27T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2022-11-27T00:00:00+00:00","frequency":"day","data":[{"date":"2022-11-27T00:00:00+00:00","rate":0.0,"value":"0"}]}]' + string: '[{"period":"2020-09-29T00:00:00+00:00","frequency":"day","data":[{"date":"2020-09-29T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-09-30T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-01T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-02T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-03T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-04T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-05T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-06T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-07T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-08T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-09T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2020-09-30T00:00:00+00:00","frequency":"day","data":[{"date":"2020-09-30T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-01T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-02T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-03T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-04T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-05T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-06T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-07T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-08T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-09T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2020-10-01T00:00:00+00:00","frequency":"day","data":[{"date":"2020-10-01T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-02T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-03T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-04T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-05T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-06T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-07T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-08T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-09T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2020-10-02T00:00:00+00:00","frequency":"day","data":[{"date":"2020-10-02T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-03T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-04T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-05T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-06T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-07T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-08T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-09T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2020-10-03T00:00:00+00:00","frequency":"day","data":[{"date":"2020-10-03T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-04T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-05T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-06T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-07T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-08T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-09T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2020-10-04T00:00:00+00:00","frequency":"day","data":[{"date":"2020-10-04T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-05T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-06T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-07T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-08T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-09T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2020-10-05T00:00:00+00:00","frequency":"day","data":[{"date":"2020-10-05T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-06T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-07T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-08T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-09T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2020-10-06T00:00:00+00:00","frequency":"day","data":[{"date":"2020-10-06T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-07T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-08T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-09T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2020-10-07T00:00:00+00:00","frequency":"day","data":[{"date":"2020-10-07T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-08T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-09T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2020-10-08T00:00:00+00:00","frequency":"day","data":[{"date":"2020-10-08T00:00:00+00:00","rate":0.0,"value":"0"},{"date":"2020-10-09T00:00:00+00:00","rate":0.0,"value":"0"}]},{"period":"2020-10-09T00:00:00+00:00","frequency":"day","data":[{"date":"2020-10-09T00:00:00+00:00","rate":0.0,"value":"0"}]}]' 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-AkyM5KkEra/OBSMZSu3SqQ==''; + style-src ''self'' http://localhost:3000 ''nonce-ei/p9PPEqvg9vtmL9FKIAQ==''; 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 @@ -174,7 +174,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"c607f49eb27c19d561dab0434594a06e" + - W/"7c0b9d5d1e0b7ed4fc44340469c598c1" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -190,9 +190,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 67a94c6b-e1fe-4c60-90c5-478c98e3e0f7 + - 9804c083-8453-4e71-ae5e-602db2e2a232 X-Runtime: - - '0.435749' + - '0.174288' X-XSS-Protection: - 1; mode=block status: diff --git a/tests/test_admin.py b/tests/test_admin.py index 49d9876..f0aa1fc 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -140,8 +140,8 @@ def test_admin_domain_blocks(api2): @pytest.mark.vcr() def test_admin_stats(api2): assert api2.admin_measures( - datetime.now() - timedelta(hours=24*5), - datetime.now(), + datetime(2020, 10, 10) - timedelta(hours=24*5), + datetime(2020, 10, 10), active_users=True, new_users=True, opened_reports=True, @@ -158,8 +158,8 @@ def test_admin_stats(api2): ) assert api2.admin_dimensions( - datetime.now() - timedelta(hours=24*5), - datetime.now(), + datetime(2020, 10, 10) - timedelta(hours=24*5), + datetime(2020, 10, 10), limit=3, languages=True, sources=True, @@ -172,13 +172,13 @@ def test_admin_stats(api2): ) api2.admin_retention( - datetime.now() - timedelta(days=10), - datetime.now() + datetime(2020, 10, 10) - timedelta(days=10), + datetime(2020, 10, 10) ) with pytest.raises(MastodonIllegalArgumentError): api2.admin_retention( - datetime.now() - timedelta(days=10), - datetime.now(), + datetime(2020, 10, 10) - timedelta(days=10), + datetime(2020, 10, 10), frequency="dayz" ) \ No newline at end of file -- cgit v1.2.3