feat: ruff'ed

This commit is contained in:
2025-05-02 08:38:57 +02:00
parent 32b36b81b3
commit 48b53d851a
62 changed files with 2019 additions and 3655 deletions
+4 -7
View File
@@ -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