You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
690 B
Python
34 lines
690 B
Python
import uuid
|
|
from datetime import datetime
|
|
|
|
from factory import (
|
|
LazyAttribute,
|
|
LazyFunction,
|
|
Sequence,
|
|
SubFactory,
|
|
post_generation,
|
|
SelfAttribute,
|
|
)
|
|
from factory.alchemy import SQLAlchemyModelFactory
|
|
from factory.fuzzy import FuzzyChoice, FuzzyDateTime, FuzzyInteger, FuzzyText
|
|
from faker import Faker
|
|
from faker.providers import misc
|
|
# from pytz import UTC
|
|
|
|
|
|
from .database import Session
|
|
|
|
fake = Faker()
|
|
fake.add_provider(misc)
|
|
|
|
|
|
class BaseFactory(SQLAlchemyModelFactory):
|
|
"""Base Factory."""
|
|
|
|
class Meta:
|
|
"""Factory configuration."""
|
|
|
|
abstract = True
|
|
sqlalchemy_session = Session
|
|
sqlalchemy_session_persistence = "commit"
|