diff options
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..6239eb3 --- /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:ietf: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; | ||