1919class 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" ,
42424343 "--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