fix(lint): resolve ruff errors in tests and run_tests.py

- Fix import sorting (I001)
- Remove unused imports and variables (F401, F841)
- Add noqa for test code (S106 hardcoded passwords, S314 XML parsing)
- Auto-format with ruff format
This commit is contained in:
2026-02-02 12:44:37 +01:00
parent 97a7764155
commit 3f222a9141
12 changed files with 87 additions and 70 deletions

View File

@@ -16,9 +16,7 @@ class UserFactory(factory.django.DjangoModelFactory):
email = factory.LazyAttribute(lambda _: fake.unique.email())
username = factory.LazyAttribute(lambda _: fake.unique.user_name())
phone = factory.LazyAttribute(
lambda _: f"+7{fake.numerify('##########')}"
)
phone = factory.LazyAttribute(lambda _: f"+7{fake.numerify('##########')}")
is_verified = False
is_staff = False
is_superuser = False
@@ -58,7 +56,9 @@ class ProfileFactory(factory.django.DjangoModelFactory):
class Meta:
model = Profile
django_get_or_create = ("user",) # Используем get_or_create для избежания дубликатов
django_get_or_create = (
"user",
) # Используем get_or_create для избежания дубликатов
user = factory.SubFactory(UserFactory)
first_name = factory.LazyAttribute(lambda _: fake.first_name())