diff options
author | codl <[email protected]> | 2017-11-27 02:25:33 +0100 |
---|---|---|
committer | codl <[email protected]> | 2017-11-27 03:12:02 +0100 |
commit | 4b60a0d3cfba50319d2a8a47458db9a89a1a4f12 (patch) | |
tree | 0d61d4e79ed28567b8ab63b12d98aaa463927b0f /tests/setup_app.sql | |
parent | 430bebc12481c1ad44592f03ad7d8acbed370eab (diff) | |
download | mastodon.py-4b60a0d3cfba50319d2a8a47458db9a89a1a4f12.tar.gz |
add tests for json hooks
including a failing test for that thing i fixed earlier which isn't
in this branch 😓
Diffstat (limited to 'tests/setup_app.sql')
-rw-r--r-- | tests/setup_app.sql | 37 |
1 files changed, 37 insertions, 0 deletions
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 @@ | |||
1 | WITH new_app AS ( | ||
2 | INSERT INTO oauth_applications ( | ||
3 | name, | ||
4 | uid, | ||
5 | secret, | ||
6 | redirect_uri, | ||
7 | scopes, | ||
8 | owner_type, | ||
9 | owner_id, | ||
10 | created_at, | ||
11 | updated_at | ||
12 | ) VALUES ( | ||
13 | 'Mastodon.py test suite', | ||
14 | '__MASTODON_PY_TEST_ID', | ||
15 | '__MASTODON_PY_TEST_SECRET', | ||
16 | 'urn:itef:wg:oauth:2.0:oob', | ||
17 | 'read write follow', | ||
18 | 'User', | ||
19 | 1, | ||
20 | now(), | ||
21 | now() | ||
22 | ) | ||
23 | RETURNING id | ||
24 | ) | ||
25 | INSERT INTO oauth_access_tokens ( | ||
26 | token, | ||
27 | scopes, | ||
28 | application_id, | ||
29 | resource_owner_id, | ||
30 | created_at | ||
31 | ) SELECT | ||
32 | '__MASTODON_PY_TEST_TOKEN', | ||
33 | 'read write follow', | ||
34 | new_app.id, | ||
35 | 1, | ||
36 | now() | ||
37 | FROM new_app; | ||