Skip to content

Commit caaf6c0

Browse files
committed
Rename command as create_api_user
Prefer underscore to dash Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent 6cd8538 commit caaf6c0

File tree

3 files changed

+6
-62
lines changed

3 files changed

+6
-62
lines changed

docs/source/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Create an API key-only user
2525

2626
This can be done in the admin and from the command line::
2727

28-
$ ./manage.py create-api-user --email "[email protected]" --first-name="Phil" --last-name "Goel"
28+
$ ./manage.py create_api_user --email "[email protected]" --first-name="Phil" --last-name "Goel"
2929
User [email protected] created with API key: ce8616b929d2adsddd6146346c2f26536423423491
3030

3131

vulnerabilities/management/commands/create-api-user.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

vulnerabilities/tests/test_create_api_user_command.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class TestCreateApiUserCommand(TestCase):
2020
def test_create_simple_user(self):
2121
buf = StringIO()
22-
call_command("create-api-user", "--email", "[email protected]", stdout=buf)
22+
call_command("create_api_user", "--email", "[email protected]", stdout=buf)
2323
output = buf.getvalue()
2424
User = get_user_model()
2525
user = User.objects.get(username="[email protected]")
@@ -29,15 +29,15 @@ def test_create_simple_user(self):
2929
assert f"User [email protected] created with API key: {user.auth_token.key}" in output
3030

3131
def test_create_simple_user_cannot_create_user_twice_with_same_email(self):
32-
call_command("create-api-user", "--email", "[email protected]")
32+
call_command("create_api_user", "--email", "[email protected]")
3333

3434
with pytest.raises(CommandError):
35-
call_command("create-api-user", "--email", "[email protected]")
35+
call_command("create_api_user", "--email", "[email protected]")
3636

3737
def test_create_user_with_names(self):
3838
buf = StringIO()
3939
call_command(
40-
"create-api-user",
40+
"create_api_user",
4141
"--email",
4242
4343
"--first-name",
@@ -55,4 +55,4 @@ def test_create_user_with_names(self):
5555

5656
def test_create_simple_user_demands_a_valid_email(self):
5757
with pytest.raises(CommandError):
58-
call_command("create-api-user", "--email", "fooNOT AN EMAIL.com")
58+
call_command("create_api_user", "--email", "fooNOT AN EMAIL.com")

0 commit comments

Comments
 (0)