diff --git a/src/openforms/registrations/contrib/json/tests/test_backend.py b/src/openforms/registrations/contrib/json/tests/test_backend.py index 71025c4b41..6e377c80c1 100644 --- a/src/openforms/registrations/contrib/json/tests/test_backend.py +++ b/src/openforms/registrations/contrib/json/tests/test_backend.py @@ -1,3 +1,5 @@ +from unittest.mock import patch + from django.test import TestCase from openforms.appointments.contrib.qmatic.tests.factories import ServiceFactory @@ -47,15 +49,17 @@ def test_submission_with_json_backend(self): ) json_form_options = dict( - service=ServiceFactory(), - relative_api_endpoint="test", + service=ServiceFactory(api_root="http://example.com/api/v2"), + relative_api_endpoint="", form_variables=["firstName", "lastName", "file", "auth_bsn"], ) email_submission = JSONRegistration("json_plugin") set_submission_reference(submission) - data_to_be_sent = email_submission.register_submission(submission, json_form_options) + with patch("zgw_consumers.nlx.NLXClient.post") as mock_post: + data_to_be_sent = email_submission.register_submission(submission, json_form_options) + mock_post.assert_called_once() expected_data_to_be_sent = { "values": {