Skip to content

Commit

Permalink
Merge pull request #3875 from open-formulieren/chore/3049-upgrade-fac…
Browse files Browse the repository at this point in the history
…tory-boy

Bump to the latest factory-boy version
  • Loading branch information
sergei-maertens authored Feb 13, 2024
2 parents 81a5f15 + 712636e commit 0f31d3f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
6 changes: 2 additions & 4 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,12 @@ face==20.1.1
# -c requirements/base.txt
# -r requirements/base.txt
# glom
factory-boy==3.0.1
factory-boy==3.3.0
# via
# -r requirements/test-tools.in
# django-simple-certmanager
# zgw-consumers
faker==7.0.1
faker==23.1.0
# via
# factory-boy
# zgw-consumers
Expand Down Expand Up @@ -954,8 +954,6 @@ tblib==1.7.0
# via -r requirements/test-tools.in
testfixtures==6.17.1
# via -r requirements/test-tools.in
text-unidecode==1.3
# via faker
tinycss2==1.1.0
# via
# -c requirements/base.txt
Expand Down
9 changes: 2 additions & 7 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,13 @@ face==20.1.1
# -c requirements/ci.txt
# -r requirements/ci.txt
# glom
factory-boy==3.0.1
factory-boy==3.3.0
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
# django-simple-certmanager
# zgw-consumers
faker==7.0.1
faker==23.1.0
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
Expand Down Expand Up @@ -1120,11 +1120,6 @@ testfixtures==6.17.1
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
text-unidecode==1.3
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
# faker
tinycss2==1.1.0
# via
# -c requirements/ci.txt
Expand Down
5 changes: 4 additions & 1 deletion src/openforms/payments/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from unittest.mock import patch

import factory
import faker

from openforms.config.models import GlobalConfiguration
from openforms.submissions.tests.factories import SubmissionFactory
Expand All @@ -18,11 +19,13 @@ def mocked_create_public_order_id_for(
payment.public_order_id = extracted
return

fake = faker.Faker()

with patch(
"openforms.payments.models.GlobalConfiguration.get_solo",
return_value=GlobalConfiguration(),
):
pk = factory.Faker("random_int").generate() if not create else None
pk = fake.random_int() if not create else None
payment.public_order_id = SubmissionPaymentManager.create_public_order_id_for(
payment, pk=pk
)
Expand Down
4 changes: 3 additions & 1 deletion src/openforms/submissions/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.utils.translation import get_language

import factory
import faker
import magic
from glom import PathAccessError, glom

Expand Down Expand Up @@ -336,7 +337,8 @@ def create(

# this is no longer a field on the model, but we still want to use the form/sub-variable generating machinery below
if form_key is None:
form_key = factory.Faker("slug").generate()
fake = faker.Faker()
form_key = fake.slug()

submission = file_attachment.submission_step.submission
form_variable = submission.form.formvariable_set.filter(key=form_key).first()
Expand Down

0 comments on commit 0f31d3f

Please sign in to comment.