diff options
Diffstat (limited to 'tests/setup.sql')
-rw-r--r-- | tests/setup.sql | 84 |
1 files changed, 84 insertions, 0 deletions
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 @@ | |||
1 | DELETE FROM oauth_access_tokens WHERE id = 6543210987654321; | ||
2 | DELETE FROM oauth_access_tokens WHERE id = 1234567890123456; | ||
3 | DELETE FROM oauth_applications WHERE id = 1234567890123456; | ||
4 | DELETE FROM users WHERE id = 1234567890123456; | ||
5 | DELETE FROM accounts WHERE id = 1234567890123456; | ||
6 | |||
7 | INSERT INTO accounts ( | ||
8 | id, | ||
9 | username, | ||
10 | created_at, | ||
11 | updated_at | ||
12 | ) VALUES ( | ||
13 | 1234567890123456, | ||
14 | 'mastodonpy_test', | ||
15 | now(), | ||
16 | now() | ||
17 | ); | ||
18 | |||
19 | INSERT INTO users ( | ||
20 | id, | ||
21 | email, | ||
22 | account_id, | ||
23 | created_at, | ||
24 | updated_at, | ||
25 | confirmed_at, | ||
26 | locale | ||
27 | ) VALUES ( | ||
28 | 1234567890123456, | ||
29 | 'mastodonpy_test@localhost:3000', | ||
30 | 1234567890123456, | ||
31 | now(), | ||
32 | now(), | ||
33 | now(), | ||
34 | 'ja' -- japanese locale for unicode testing :p | ||
35 | ); | ||
36 | |||
37 | |||
38 | |||
39 | INSERT INTO oauth_applications ( | ||
40 | id, | ||
41 | name, | ||
42 | uid, | ||
43 | secret, | ||
44 | redirect_uri, | ||
45 | scopes, | ||
46 | owner_type, | ||
47 | owner_id, | ||
48 | created_at, | ||
49 | updated_at | ||
50 | ) VALUES ( | ||
51 | 1234567890123456, | ||
52 | 'Mastodon.py test suite', | ||
53 | '__MASTODON_PY_TEST_CLIENT_ID', | ||
54 | '__MASTODON_PY_TEST_CLIENT_SECRET', | ||
55 | 'urn:ietf:wg:oauth:2.0:oob', | ||
56 | 'read write follow', | ||
57 | 'User', | ||
58 | 1234567890123456, | ||
59 | now(), | ||
60 | now() | ||
61 | ); | ||
62 | |||
63 | INSERT INTO oauth_access_tokens ( | ||
64 | id, | ||
65 | token, | ||
66 | scopes, | ||
67 | application_id, | ||
68 | resource_owner_id, | ||
69 | created_at | ||
70 | ) VALUES ( | ||
71 | 1234567890123456, | ||
72 | '__MASTODON_PY_TEST_ACCESS_TOKEN', | ||
73 | 'read write follow', | ||
74 | 1234567890123456, | ||
75 | 1234567890123456, | ||
76 | now() | ||
77 | ), ( | ||
78 | 6543210987654321, | ||
79 | '__MASTODON_PY_TEST_ACCESS_TOKEN_2', | ||
80 | 'read write follow', | ||
81 | 1234567890123456, | ||
82 | 1, | ||
83 | now() | ||
84 | ); | ||