aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_create_app.py')
-rw-r--r--tests/test_create_app.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_create_app.py b/tests/test_create_app.py
index 67318e9..f1153bc 100644
--- a/tests/test_create_app.py
+++ b/tests/test_create_app.py
@@ -1,6 +1,8 @@
1from mastodon import Mastodon 1from mastodon import Mastodon
2import pytest 2import pytest
3import requests 3import requests
4import time
5
4try: 6try:
5 from mock import Mock 7 from mock import Mock
6except ImportError: 8except ImportError:
@@ -46,3 +48,22 @@ def test_app_verify_credentials(api):
46 app = api.app_verify_credentials() 48 app = api.app_verify_credentials()
47 assert app 49 assert app
48 assert app.name == 'Mastodon.py test suite' 50 assert app.name == 'Mastodon.py test suite'
51
52@pytest.mark.vcr()
53def test_app_account_create():
54 # This leaves behind stuff on the test server, which is unfortunate, but eh.
55 suffix = str(time.time()).replace(".", "")[-5:]
56
57 test_app = test_app = Mastodon.create_app(
58 "mastodon.py generated test app",
59 api_base_url="http://localhost:3000/"
60 )
61
62 test_app_api = Mastodon(
63 test_app[0],
64 test_app[1],
65 api_base_url="http://localhost:3000/"
66 )
67 test_token = test_app_api.create_account("coolguy" + suffix, "swordfish", "email@localhost" + suffix, agreement=True)
68 assert test_token
69
Powered by cgit v1.2.3 (git 2.41.0)