-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eec665e
commit d38ac2a
Showing
4 changed files
with
14 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
import factory | ||
from api.models.indiening import Indiening | ||
from api.models.groep import Groep | ||
from django.core.files.base import ContentFile | ||
from api.tests.factories.groep import GroepFactory | ||
from django.utils import timezone | ||
from faker import Faker | ||
|
||
|
||
class GroepFactory(factory.django.DjangoModelFactory): | ||
class Meta: | ||
model = Groep | ||
|
||
# Add fields here. For example: | ||
# field_name = factory.Faker('pystr') | ||
fake = Faker() | ||
|
||
|
||
class IndieningFactory(factory.django.DjangoModelFactory): | ||
class Meta: | ||
model = Indiening | ||
|
||
indiener = factory.SubFactory(GroepFactory) | ||
indieningsbestanden = factory.django.FileField( | ||
from_path=ContentFile(b"file content") | ||
indieningsbestanden = factory.django.FileField(data=b"file content") | ||
tijdstip = factory.LazyFunction( | ||
lambda: timezone.make_aware( | ||
fake.date_time_between(start_date="+1d", end_date="+30d") | ||
) | ||
) | ||
tijdstip = factory.Faker("date_time_this_year") |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
class ScoreFactory(factory.django.DjangoModelFactory): | ||
class Meta: | ||
model = Score | ||
score = factory.Faker('pyint') |
This file contains 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