Last active
February 18, 2019 20:14
-
-
Save eeriksp/e1d8b5ebb91d9fc103ce33d63a984ed3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from factory.django import DjangoModelFactory as ModelFactory | |
class ProjectFactory(ModelFactory): | |
class Meta: | |
model = Project | |
director = factory.SubFactory(VolunteerFactory) # Creates dependency | |
warehouse = factory.Sequence(lambda n: f'Project__name-{n}') # Guarantees uniqueness | |
deadline = factory.LazyFunction(datetime.date.today) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment