File tree Expand file tree Collapse file tree
backend/kernelCI_app/tests/factories Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33"""
44
55import factory
6- from django .utils import timezone
76from factory .django import DjangoModelFactory
87
98from kernelCI_app .models import Builds , StatusChoices
109
1110from .checkout_factory import CheckoutFactory
1211from .mocks import Build , Checkout
12+ from .seed_time import seeded_timestamp
1313
1414
1515class BuildFactory (DjangoModelFactory ):
@@ -93,4 +93,4 @@ class Meta:
9393 )
9494 )
9595
96- field_timestamp = factory .LazyFunction (lambda : timezone . now () )
96+ field_timestamp = factory .LazyFunction (seeded_timestamp )
Original file line number Diff line number Diff line change 99from kernelCI_app .models import Checkouts
1010
1111from .mocks import Checkout
12+ from .seed_time import seeded_timestamp
1213
1314
1415class CheckoutFactory (DjangoModelFactory ):
@@ -137,4 +138,4 @@ class Meta:
137138 lambda : timezone .now () - timezone .timedelta (minutes = 15 )
138139 )
139140
140- field_timestamp = factory .LazyFunction (lambda : timezone . now () )
141+ field_timestamp = factory .LazyFunction (seeded_timestamp )
Original file line number Diff line number Diff line change 1010
1111from .build_factory import BuildFactory
1212from .issue_factory import IssueFactory
13+ from .seed_time import seeded_timestamp
1314from .test_factory import TestFactory
1415
1516
@@ -42,4 +43,4 @@ class Meta:
4243 }
4344 )
4445
45- field_timestamp = factory .LazyFunction (lambda : timezone . now () )
46+ field_timestamp = factory .LazyFunction (seeded_timestamp )
Original file line number Diff line number Diff line change 33"""
44
55import factory
6- from django .utils import timezone
76from factory .django import DjangoModelFactory
87
98from kernelCI_app .models import Issues
109
1110from .mocks import Issue
11+ from .seed_time import seeded_timestamp
1212
1313
1414class IssueFactory (DjangoModelFactory ):
@@ -59,4 +59,4 @@ class Meta:
5959 }
6060 )
6161
62- field_timestamp = factory .LazyFunction (lambda : timezone . now () )
62+ field_timestamp = factory .LazyFunction (seeded_timestamp )
Original file line number Diff line number Diff line change 33"""
44
55import factory
6- from django .utils import timezone
76from factory .django import DjangoModelFactory
87
98from kernelCI_app .models import StatusChoices , Tests
109
1110from .build_factory import BuildFactory
1211from .mocks import Checkout , Test
12+ from .seed_time import seeded_timestamp
1313
1414
1515class TestFactory (DjangoModelFactory ):
@@ -95,4 +95,4 @@ class Meta:
9595 )
9696 )
9797
98- field_timestamp = factory .LazyFunction (lambda : timezone . now () )
98+ field_timestamp = factory .LazyFunction (seeded_timestamp )
You can’t perform that action at this time.
0 commit comments