aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/setup_app.sql')
-rw-r--r--tests/setup_app.sql37
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 @@
1WITH 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)
25INSERT 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()
37FROM new_app;
Powered by cgit v1.2.3 (git 2.41.0)