From 4b60a0d3cfba50319d2a8a47458db9a89a1a4f12 Mon Sep 17 00:00:00 2001 From: codl Date: Mon, 27 Nov 2017 02:25:33 +0100 Subject: add tests for json hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit including a failing test for that thing i fixed earlier which isn't in this branch 😓 --- tests/setup_app.sql | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/setup_app.sql (limited to 'tests/setup_app.sql') diff --git a/tests/setup_app.sql b/tests/setup_app.sql new file mode 100644 index 0000000..b9f3db9 --- /dev/null +++ b/tests/setup_app.sql @@ -0,0 +1,37 @@ +WITH new_app AS ( + INSERT INTO oauth_applications ( + name, + uid, + secret, + redirect_uri, + scopes, + owner_type, + owner_id, + created_at, + updated_at + ) VALUES ( + 'Mastodon.py test suite', + '__MASTODON_PY_TEST_ID', + '__MASTODON_PY_TEST_SECRET', + 'urn:itef:wg:oauth:2.0:oob', + 'read write follow', + 'User', + 1, + now(), + now() + ) + RETURNING id +) +INSERT INTO oauth_access_tokens ( + token, + scopes, + application_id, + resource_owner_id, + created_at +) SELECT + '__MASTODON_PY_TEST_TOKEN', + 'read write follow', + new_app.id, + 1, + now() +FROM new_app; -- cgit v1.2.3