Skip to content

Commit 4c86bcb

Browse files
💚 Fix CI failure
The test was failing because there already is factory-level machinery that ensures the form/submission variables exist as expected. (cherry picked from commit a3d52b3)
1 parent 87c96f1 commit 4c86bcb

File tree

1 file changed

+28
-34
lines changed

1 file changed

+28
-34
lines changed

src/openforms/submissions/tests/test_submission_attachment.py

+28-34
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
SubmissionFactory,
2727
SubmissionFileAttachmentFactory,
2828
SubmissionStepFactory,
29-
SubmissionValueVariableFactory,
3029
TemporaryFileUploadFactory,
3130
)
3231

@@ -490,7 +489,34 @@ def test_attach_uploads_to_submission_step_with_nested_fields(self, resize_mock)
490489
def test_attach_uploads_to_submission_step_with_nested_fields_with_matching_keys(
491490
self, resize_mock
492491
):
493-
submission = SubmissionFactory.create()
492+
submission = SubmissionFactory.create(
493+
form__generate_minimal_setup=True,
494+
form__formstep__form_definition__configuration={
495+
"components": [
496+
{
497+
"key": "repeatingGroup",
498+
"type": "editgrid",
499+
"components": [
500+
{
501+
"type": "file",
502+
"key": "attachment",
503+
"registration": {
504+
"informatieobjecttype": "http://oz.nl/catalogi/api/v1/informatieobjecttypen/123-123-123"
505+
},
506+
}
507+
],
508+
},
509+
{
510+
"key": "attachment",
511+
"type": "file",
512+
"registration": {
513+
"informatieobjecttype": "http://oz.nl/catalogi/api/v1/informatieobjecttypen/456-456-456"
514+
},
515+
},
516+
]
517+
},
518+
)
519+
form_step = submission.form.formstep_set.get()
494520
attachment_1 = TemporaryFileUploadFactory.create(
495521
submission=submission, file_name="attachmentInside.pdf"
496522
)
@@ -539,41 +565,9 @@ def test_attach_uploads_to_submission_step_with_nested_fields_with_matching_keys
539565
}
540566
],
541567
}
542-
components = [
543-
{
544-
"key": "repeatingGroup",
545-
"type": "editgrid",
546-
"components": [
547-
{
548-
"type": "file",
549-
"key": "attachment",
550-
"registration": {
551-
"informatieobjecttype": "http://oz.nl/catalogi/api/v1/informatieobjecttypen/123-123-123"
552-
},
553-
}
554-
],
555-
},
556-
{
557-
"key": "attachment",
558-
"type": "file",
559-
"registration": {
560-
"informatieobjecttype": "http://oz.nl/catalogi/api/v1/informatieobjecttypen/456-456-456"
561-
},
562-
},
563-
]
564-
form_step = FormStepFactory.create(
565-
form=submission.form,
566-
form_definition__configuration={"components": components},
567-
)
568568
submission_step = SubmissionStepFactory.create(
569569
form_step=form_step, submission=submission, data=data
570570
)
571-
# TODO: remove once #2728 is fixed
572-
SubmissionValueVariableFactory.create(
573-
key="attachment",
574-
submission=submission,
575-
value=data["attachment"],
576-
)
577571

578572
result = attach_uploads_to_submission_step(submission_step)
579573

0 commit comments

Comments
 (0)