-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: create user with profile (#433)
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -31,6 +31,45 @@ def test_cli_createuser(app): | |
result = runner.invoke(users_create, ["not-an-email", "--password", "123456"]) | ||
assert result.exit_code == 2 | ||
|
||
# Create user with profile | ||
result = runner.invoke( | ||
users_create, | ||
[ | ||
"--password", | ||
"AValidPassword66!", | ||
"--profile", | ||
'{"full_name" : "Test User"}', | ||
"[email protected]", | ||
], | ||
) | ||
assert result.exit_code == 0 | ||
|
||
# Create user with profile that is not valid JSON | ||
result = runner.invoke( | ||
users_create, | ||
[ | ||
"--password", | ||
"AValidPassword66!", | ||
"--profile", | ||
"<json>profile</json>", | ||
"[email protected]", | ||
], | ||
) | ||
assert result.exit_code != 0 | ||
|
||
# Create user with JSON profile that will not validate | ||
result = runner.invoke( | ||
users_create, | ||
[ | ||
"--password", | ||
"AValidPassword66!", | ||
"--profile", | ||
'{"full_name" : "test_user", "extra_data" : "not_allowed"}', | ||
"[email protected]", | ||
], | ||
) | ||
assert result.exit_code != 0 | ||
|
||
# Create user | ||
result = runner.invoke( | ||
users_create, ["[email protected]", "--password", "123456"] | ||
|