Add initial implementations for forms and organization apps with serializers, factories, and admin configurations
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 5m5s
CI/CD Pipeline / Run Tests (push) Failing after 5m5s
CI/CD Pipeline / Build Docker Images (push) Has been skipped
CI/CD Pipeline / Push to Gitea Registry (push) Has been skipped
CI/CD Pipeline / Deploy to Server (push) Has been skipped

This commit is contained in:
2026-02-17 09:26:08 +01:00
parent fd2adf9ab4
commit 8ed3e1175c
119 changed files with 9091 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
"""Factories for organization app."""
import factory
from apps.organization.models import Organization
from faker import Faker
fake = Faker("ru_RU")
class OrganizationFactory(factory.django.DjangoModelFactory):
"""Factory for Organization model."""
class Meta:
model = Organization
name = factory.LazyAttribute(lambda _: fake.company())
inn = factory.LazyAttribute(lambda _: fake.numerify("##########"))
ogrn = factory.LazyAttribute(lambda _: fake.numerify("#############"))
kpp = factory.LazyAttribute(lambda _: fake.numerify("#########"))
okpo = factory.LazyAttribute(lambda _: fake.numerify("########"))
@classmethod
def create_organization(cls, **kwargs):
"""Create organization with defaults."""
return cls.create(**kwargs)