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
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:
25
tests/apps/organization/factories.py
Normal file
25
tests/apps/organization/factories.py
Normal 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)
|
||||
Reference in New Issue
Block a user