From 7d51c0b17efe21f552f5d7f47b276810f9aa0280 Mon Sep 17 00:00:00 2001 From: codl Date: Wed, 29 Nov 2017 23:06:28 +0100 Subject: update test docs --- tests/setup.sql | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 tests/setup.sql (limited to 'tests/setup.sql') diff --git a/tests/setup.sql b/tests/setup.sql new file mode 100644 index 0000000..81f1e18 --- /dev/null +++ b/tests/setup.sql @@ -0,0 +1,84 @@ +DELETE FROM oauth_access_tokens WHERE id = 6543210987654321; +DELETE FROM oauth_access_tokens WHERE id = 1234567890123456; +DELETE FROM oauth_applications WHERE id = 1234567890123456; +DELETE FROM users WHERE id = 1234567890123456; +DELETE FROM accounts WHERE id = 1234567890123456; + +INSERT INTO accounts ( + id, + username, + created_at, + updated_at +) VALUES ( + 1234567890123456, + 'mastodonpy_test', + now(), + now() +); + +INSERT INTO users ( + id, + email, + account_id, + created_at, + updated_at, + confirmed_at, + locale +) VALUES ( + 1234567890123456, + 'mastodonpy_test@localhost:3000', + 1234567890123456, + now(), + now(), + now(), + 'ja' -- japanese locale for unicode testing :p +); + + + +INSERT INTO oauth_applications ( + id, + name, + uid, + secret, + redirect_uri, + scopes, + owner_type, + owner_id, + created_at, + updated_at +) VALUES ( + 1234567890123456, + 'Mastodon.py test suite', + '__MASTODON_PY_TEST_CLIENT_ID', + '__MASTODON_PY_TEST_CLIENT_SECRET', + 'urn:ietf:wg:oauth:2.0:oob', + 'read write follow', + 'User', + 1234567890123456, + now(), + now() +); + +INSERT INTO oauth_access_tokens ( + id, + token, + scopes, + application_id, + resource_owner_id, + created_at +) VALUES ( + 1234567890123456, + '__MASTODON_PY_TEST_ACCESS_TOKEN', + 'read write follow', + 1234567890123456, + 1234567890123456, + now() +), ( + 6543210987654321, + '__MASTODON_PY_TEST_ACCESS_TOKEN_2', + 'read write follow', + 1234567890123456, + 1, + now() +); -- cgit v1.2.3 From 9227528a1504ec79cf5af8e4aa15c702215abb3c Mon Sep 17 00:00:00 2001 From: codl Date: Thu, 30 Nov 2017 01:54:52 +0100 Subject: add tests for follow request methods --- tests/setup.sql | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/setup.sql') diff --git a/tests/setup.sql b/tests/setup.sql index 81f1e18..d65e503 100644 --- a/tests/setup.sql +++ b/tests/setup.sql @@ -7,11 +7,13 @@ DELETE FROM accounts WHERE id = 1234567890123456; INSERT INTO accounts ( id, username, + locked, created_at, updated_at ) VALUES ( 1234567890123456, 'mastodonpy_test', + 't', now(), now() ); -- cgit v1.2.3 From 2abb1f171579d7c7b4eadbe3bfde72499174427f Mon Sep 17 00:00:00 2001 From: codl Date: Thu, 30 Nov 2017 02:05:09 +0100 Subject: disable follow request emails on test user --- tests/setup.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/setup.sql') diff --git a/tests/setup.sql b/tests/setup.sql index d65e503..0ff6da0 100644 --- a/tests/setup.sql +++ b/tests/setup.sql @@ -1,3 +1,4 @@ +DELETE FROM settings WHERE id = 1234567890123456; DELETE FROM oauth_access_tokens WHERE id = 6543210987654321; DELETE FROM oauth_access_tokens WHERE id = 1234567890123456; DELETE FROM oauth_applications WHERE id = 1234567890123456; @@ -84,3 +85,21 @@ INSERT INTO oauth_access_tokens ( 1, now() ); + +INSERT INTO settings ( + id, + var, + value, + thing_type, + thing_id, + created_at, + updated_at +) VALUES ( + 1234567890123456, + 'notification_emails', + E'---\nfollow_request: false', + 'User', + 1234567890123456, + now(), + now() +) -- cgit v1.2.3