@@ -198,9 +198,6 @@ def test_submission_completed_payment_needed(self):
198
198
subject = "Confirmation of your {{ form_name }} submission" ,
199
199
content = "Custom content {% appointment_information %} {% payment_information %} {% cosign_information %}" ,
200
200
)
201
- SubmissionPaymentFactory .create (
202
- submission = submission , amount = 10 , status = PaymentStatus .started
203
- )
204
201
205
202
with (
206
203
patch (
@@ -222,6 +219,11 @@ def test_submission_completed_payment_needed(self):
222
219
223
220
submission .refresh_from_db ()
224
221
222
+ # We then create the submission payment, as it requires a public reference
223
+ SubmissionPaymentFactory .create (
224
+ submission = submission , amount = 10 , status = PaymentStatus .started
225
+ )
226
+
225
227
self .assertEqual (submission .public_registration_reference , "OF-TEST!" )
226
228
self .assertTrue (SubmissionReport .objects .filter (submission = submission ).exists ())
227
229
mock_registration .assert_called ()
@@ -283,9 +285,6 @@ def test_submission_completed_payment_and_cosign_needed(self):
283
285
subject = "Confirmation of your {{ form_name }} submission" ,
284
286
content = "Custom content {% appointment_information %} {% payment_information %} {% cosign_information %}" ,
285
287
)
286
- SubmissionPaymentFactory .create (
287
- submission = submission , amount = 10 , status = PaymentStatus .started
288
- )
289
288
290
289
with (
291
290
patch (
@@ -303,6 +302,11 @@ def test_submission_completed_payment_and_cosign_needed(self):
303
302
304
303
submission .refresh_from_db ()
305
304
305
+ # We then create the submission payment, as it requires a public reference
306
+ SubmissionPaymentFactory .create (
307
+ submission = submission , amount = 10 , status = PaymentStatus .started
308
+ )
309
+
306
310
self .assertEqual (submission .public_registration_reference , "OF-TEST!" )
307
311
self .assertTrue (SubmissionReport .objects .filter (submission = submission ).exists ())
308
312
mock_registration .assert_not_called ()
@@ -424,7 +428,7 @@ def test_cosign_done_payment_needed_not_done(self):
424
428
},
425
429
],
426
430
submitted_data = {"email" : "test@test.nl" , "cosign" : "cosign@test.nl" },
427
- completed = True ,
431
+ with_public_registration_reference = True ,
428
432
cosign_request_email_sent = True ,
429
433
cosign_complete = True ,
430
434
confirmation_email_sent = True ,
@@ -509,7 +513,7 @@ def test_cosign_done_payment_done(self):
509
513
},
510
514
],
511
515
submitted_data = {"email" : "test@test.nl" , "cosign" : "cosign@test.nl" },
512
- completed = True ,
516
+ with_public_registration_reference = True ,
513
517
cosign_request_email_sent = True ,
514
518
cosign_complete = True ,
515
519
confirmation_email_sent = True ,
@@ -584,7 +588,7 @@ def test_payment_done_cosign_not_needed(self):
584
588
},
585
589
],
586
590
submitted_data = {"email" : "test@test.nl" },
587
- completed = True ,
591
+ with_public_registration_reference = True ,
588
592
confirmation_email_sent = True ,
589
593
form__registration_backend = "email" ,
590
594
form__registration_backend_options = {"to_emails" : ["test@registration.nl" ]},
@@ -663,7 +667,7 @@ def test_payment_done_cosign_needed_not_done(self):
663
667
},
664
668
],
665
669
submitted_data = {"email" : "test@test.nl" , "cosign" : "cosign@test.nl" },
666
- completed = True ,
670
+ with_public_registration_reference = True ,
667
671
cosign_request_email_sent = True ,
668
672
cosign_complete = False ,
669
673
cosign_confirmation_email_sent = False ,
@@ -753,6 +757,7 @@ def test_retry_flow(self):
753
757
auth_info__value = "111222333" ,
754
758
needs_on_completion_retry = True ,
755
759
registration_failed = True ,
760
+ with_public_registration_reference = True ,
756
761
with_completed_payment = True ,
757
762
)
758
763
@@ -809,6 +814,7 @@ def test_payment_status_update_retry_flow(self):
809
814
auth_info__value = "111222333" ,
810
815
needs_on_completion_retry = True ,
811
816
with_completed_payment = True ,
817
+ with_public_registration_reference = True ,
812
818
)
813
819
814
820
with (
@@ -1000,7 +1006,7 @@ def test_payment_required_and_not_should_wait_for_registration(self):
1000
1006
"confirmationRecipient" : True ,
1001
1007
}
1002
1008
],
1003
- completed = True ,
1009
+ with_public_registration_reference = True ,
1004
1010
form__registration_backend = "email" ,
1005
1011
form__registration_backend_options = {"to_emails" : ["test@registration.nl" ]},
1006
1012
form__product__price = 10 ,
@@ -1051,7 +1057,7 @@ def test_payment_done_and_should_wait_for_payment(
1051
1057
form__registration_backend_options = {"to_emails" : ["test@registration.nl" ]},
1052
1058
form__product__price = 10 ,
1053
1059
form__payment_backend = "demo" ,
1054
- completed = True ,
1060
+ with_public_registration_reference = True ,
1055
1061
with_completed_payment = True ,
1056
1062
)
1057
1063
@@ -1085,7 +1091,7 @@ def test_payment_done_and_not_should_wait_for_payment(
1085
1091
form__registration_backend_options = {"to_emails" : ["test@registration.nl" ]},
1086
1092
form__product__price = 10 ,
1087
1093
form__payment_backend = "demo" ,
1088
- completed = True ,
1094
+ with_public_registration_reference = True ,
1089
1095
with_completed_payment = True ,
1090
1096
)
1091
1097
0 commit comments