@@ -50,7 +50,9 @@ def _request_invitation_letter(client, **input):
5050 )
5151
5252
53- def test_request_invitation_letter (graphql_client , user , mock_has_ticket , mocker ):
53+ def test_request_invitation_letter (
54+ graphql_client , user , mock_has_ticket , mocker , django_capture_on_commit_callbacks
55+ ):
5456 mock_notify = mocker .patch (
5557 "api.visa.mutations.request_invitation_letter.notify_new_invitation_letter_request_on_slack"
5658 )
@@ -62,20 +64,21 @@ def test_request_invitation_letter(graphql_client, user, mock_has_ticket, mocker
6264
6365 graphql_client .force_login (user )
6466
65- response = _request_invitation_letter (
66- graphql_client ,
67- input = {
68- "conference" : conference .code ,
69- "onBehalfOf" : "SELF" ,
70- "fullName" : "Mario Rossi" ,
71- "email" : "" ,
72- "nationality" : "Italian" ,
73- "address" : "via Roma" ,
74- "passportNumber" : "YA1234567" ,
75- "embassyName" : "Italian Embassy in France" ,
76- "dateOfBirth" : "1999-01-01" ,
77- },
78- )
67+ with django_capture_on_commit_callbacks (execute = True ):
68+ response = _request_invitation_letter (
69+ graphql_client ,
70+ input = {
71+ "conference" : conference .code ,
72+ "onBehalfOf" : "SELF" ,
73+ "fullName" : "Mario Rossi" ,
74+ "email" : "" ,
75+ "nationality" : "Italian" ,
76+ "address" : "via Roma" ,
77+ "passportNumber" : "YA1234567" ,
78+ "embassyName" : "Italian Embassy in France" ,
79+ "dateOfBirth" : "1999-01-01" ,
80+ },
81+ )
7982
8083 assert (
8184 response ["data" ]["requestInvitationLetter" ]["__typename" ]
0 commit comments