feat: ruff'ed
This commit is contained in:
@@ -7,25 +7,22 @@ User = get_user_model()
|
||||
|
||||
|
||||
class TestUsers(TestCase):
|
||||
|
||||
def test_create_user(self):
|
||||
User.objects.create_user({"username": "user 1", "password": "password1"})
|
||||
User.objects.create_user({'username': 'user 1', 'password': 'password1'})
|
||||
User.objects.all().count() == 1
|
||||
|
||||
def test_new_user_invalid_username(self):
|
||||
"""Test creating user with no username raises error"""
|
||||
with pytest.raises(ValueError):
|
||||
User.objects.create_user(None, "test123")
|
||||
User.objects.create_user(None, 'test123')
|
||||
|
||||
def test_create_new_superuser(self):
|
||||
"""Test creating a new superuser"""
|
||||
# Creation with standard method
|
||||
user = User.objects.create_superuser(
|
||||
"testsuperuser@adminemail.com", "testadmin123"
|
||||
)
|
||||
user = User.objects.create_superuser('testsuperuser@adminemail.com', 'testadmin123')
|
||||
assert user.is_superuser
|
||||
assert user.is_staff
|
||||
|
||||
def test_create_group(self):
|
||||
Group.objects.create(name="Group1")
|
||||
Group.objects.create(name='Group1')
|
||||
assert Group.objects.count() == 1
|
||||
|
||||
Reference in New Issue
Block a user