From b6692f0b16820da8388a5445bcfbf464a4648c91 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sun, 28 Apr 2019 17:56:20 +0200 Subject: Add account creation --- tests/test_create_app.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/test_create_app.py') 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 @@ from mastodon import Mastodon import pytest import requests +import time + try: from mock import Mock except ImportError: @@ -46,3 +48,22 @@ def test_app_verify_credentials(api): app = api.app_verify_credentials() assert app assert app.name == 'Mastodon.py test suite' + +@pytest.mark.vcr() +def test_app_account_create(): + # This leaves behind stuff on the test server, which is unfortunate, but eh. + suffix = str(time.time()).replace(".", "")[-5:] + + test_app = test_app = Mastodon.create_app( + "mastodon.py generated test app", + api_base_url="http://localhost:3000/" + ) + + test_app_api = Mastodon( + test_app[0], + test_app[1], + api_base_url="http://localhost:3000/" + ) + test_token = test_app_api.create_account("coolguy" + suffix, "swordfish", "email@localhost" + suffix, agreement=True) + assert test_token + -- cgit v1.2.3