Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to the latest factory-boy version #3875

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading