chore: blacked

This commit is contained in:
Pablo Moreno
2024-05-13 00:42:51 +02:00
parent f3b4f3e509
commit 236fd5c37b
10 changed files with 190 additions and 134 deletions
+4 -8
View File
@@ -11,27 +11,23 @@ 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'
"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