-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get admin/api/accounts/find Get admin/api/accounts/plan
- Loading branch information
1 parent
d0c6bf7
commit 3f47e69
Showing
5 changed files
with
109 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from tests.integration import asserts | ||
|
||
def test_account_user_can_be_created(account_user,account_user_params): | ||
asserts.assert_resource(account_user) | ||
asserts.assert_resource_params(account_user,account_user_params) | ||
|
||
def test_account_users_list(api,account_user): | ||
users = api.accounts.list() | ||
assert len(users) > 1 | ||
|
||
def test_account_users_get_by_id(account,account_user,account_user_params): | ||
account_user = account.users.read(account_user['id']) | ||
asserts.assert_resource(account_user) | ||
asserts.assert_resource_params(account_user,account_user_params) | ||
|
||
|
||
def test_account_user_can_be_updated(account_user,account_user_update_params): | ||
updated_user = account_user.update(account_user_update_params) | ||
asserts.assert_resource(updated_user) | ||
asserts.assert_resource_params(updated_user, account_user_update_params) | ||
|
||
|
||
def test_account_user_change_status(account_user): | ||
assert account_user['state'] == 'pending' | ||
updated_account_user = account_user.activate() | ||
assert updated_account_user['state'] == 'active' | ||
|
||
updated_account_user = account_user.suspend() | ||
assert updated_account_user['state'] == 'suspended' | ||
|
||
updated_account_user = account_user.un_suspend() | ||
assert updated_account_user['state'] == 'active' | ||
|
||
|
||
def test_account_user_change_role(account_user): | ||
assert account_user['role'] == 'member' | ||
|
||
updated_account_user = account_user.set_as_admin() | ||
assert updated_account_user['role'] == 'admin' | ||
|
||
updated_account_user = account_user.set_as_member() | ||
assert updated_account_user['role'] == 'member' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters