|
26 | 26 | SubmissionFactory,
|
27 | 27 | SubmissionFileAttachmentFactory,
|
28 | 28 | SubmissionStepFactory,
|
29 |
| - SubmissionValueVariableFactory, |
30 | 29 | TemporaryFileUploadFactory,
|
31 | 30 | )
|
32 | 31 |
|
@@ -490,7 +489,34 @@ def test_attach_uploads_to_submission_step_with_nested_fields(self, resize_mock)
|
490 | 489 | def test_attach_uploads_to_submission_step_with_nested_fields_with_matching_keys(
|
491 | 490 | self, resize_mock
|
492 | 491 | ):
|
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() |
494 | 520 | attachment_1 = TemporaryFileUploadFactory.create(
|
495 | 521 | submission=submission, file_name="attachmentInside.pdf"
|
496 | 522 | )
|
@@ -539,41 +565,9 @@ def test_attach_uploads_to_submission_step_with_nested_fields_with_matching_keys
|
539 | 565 | }
|
540 | 566 | ],
|
541 | 567 | }
|
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 |
| - ) |
568 | 568 | submission_step = SubmissionStepFactory.create(
|
569 | 569 | form_step=form_step, submission=submission, data=data
|
570 | 570 | )
|
571 |
| - # TODO: remove once #2728 is fixed |
572 |
| - SubmissionValueVariableFactory.create( |
573 |
| - key="attachment", |
574 |
| - submission=submission, |
575 |
| - value=data["attachment"], |
576 |
| - ) |
577 | 571 |
|
578 | 572 | result = attach_uploads_to_submission_step(submission_step)
|
579 | 573 |
|
|
0 commit comments