Skip to content

Instantly share code, notes, and snippets.

@mredvard
Created August 21, 2017 17:33
Show Gist options
  • Select an option

  • Save mredvard/e767a1ef708ae3f61575a2c86e6e3c84 to your computer and use it in GitHub Desktop.

Select an option

Save mredvard/e767a1ef708ae3f61575a2c86e6e3c84 to your computer and use it in GitHub Desktop.
import factory
from faker import Faker
from core.tests.utils import create_datetime_range
from .. import models
faker = Faker()
class PricingBlockFactory(factory.django.DjangoModelFactory):
name = factory.LazyAttribute(lambda a: faker.first_name())
date_range = factory.LazyAttribute(lambda a: create_datetime_range())
amount = 25.0
prepaid_amount = 23.0
set_to_repeat = False
class Meta:
model = models.PriceBlock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment