diff options
author | halcy <halcy@ARARAGI-KUN> | 2022-11-19 02:34:01 +0200 |
---|---|---|
committer | halcy <halcy@ARARAGI-KUN> | 2022-11-19 02:34:01 +0200 |
commit | 853cd82ecb9e1d25f395514b3bb1616071d43493 (patch) | |
tree | a0812b4fa12fadd299886615669f86be6f7bd2cf /tests/test_create_app.py | |
parent | f26bf0db1dfc93fafa344977bd999a334a55cd36 (diff) | |
download | mastodon.py-853cd82ecb9e1d25f395514b3bb1616071d43493.tar.gz |
add ability to get detailed signup error from create_account
Diffstat (limited to 'tests/test_create_app.py')
-rw-r--r-- | tests/test_create_app.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/test_create_app.py b/tests/test_create_app.py index 8a7ea62..c7282df 100644 --- a/tests/test_create_app.py +++ b/tests/test_create_app.py | |||
@@ -70,5 +70,24 @@ def test_app_account_create(): | |||
70 | # We can also test resending (marginally) | 70 | # We can also test resending (marginally) |
71 | test_app_api.email_resend_confirmation() | 71 | test_app_api.email_resend_confirmation() |
72 | 72 | ||
73 | 73 | @pytest.mark.vcr(match_on=['path']) | |
74 | 74 | def test_app_account_create_invalid(): | |
75 | suffix = str(time.time()).replace(".", "")[-5:] | ||
76 | |||
77 | test_app = test_app = Mastodon.create_app( | ||
78 | "mastodon.py generated test app", | ||
79 | api_base_url="http://localhost:3000/" | ||
80 | ) | ||
81 | |||
82 | test_app_api = Mastodon( | ||
83 | test_app[0], | ||
84 | test_app[1], | ||
85 | api_base_url="http://localhost:3000/" | ||
86 | ) | ||
87 | test_token, error = test_app_api.create_account("coolguy" + suffix, "", "email@localhost" + suffix, agreement=False, return_detailed_error=True) | ||
88 | assert test_token is None | ||
89 | assert "details" in error | ||
90 | assert "password" in error.details | ||
91 | assert "password" in error.details | ||
92 | assert not "username" in error.details | ||
93 | \ No newline at end of file | ||