diff --git a/src/openforms/registrations/contrib/stuf_zds/tests/test_backend.py b/src/openforms/registrations/contrib/stuf_zds/tests/test_backend.py index 9d3c6fb15f..902505e06d 100644 --- a/src/openforms/registrations/contrib/stuf_zds/tests/test_backend.py +++ b/src/openforms/registrations/contrib/stuf_zds/tests/test_backend.py @@ -2806,3 +2806,72 @@ def test_user_defined_variables(self, m, mock_task): "//stuf:extraElementen/stuf:extraElement[@naam='userDefinedVarJson.key2.0']", "value2", ) + + @patch("celery.app.task.Task.request") + def test_plugin_with_extra_unmapped_number_data(self, m, mock_task): + submission = SubmissionFactory.from_components( + [ + { + "key": "extra_number", + }, + ], + form__name="my-form", + bsn="111222333", + public_registration_reference="foo-zaak", + registration_result={"intermediate": {"zaaknummer": "foo-zaak"}}, + submitted_data={"extra_number": 2023}, + language_code="en", + ) + + m.post( + self.service.soap_service.url, + content=load_mock("creeerZaak.xml"), + additional_matcher=match_text("zakLk01"), + ) + + m.post( + self.service.soap_service.url, + content=load_mock( + "genereerDocumentIdentificatie.xml", + {"document_identificatie": "bar-document"}, + ), + additional_matcher=match_text("genereerDocumentIdentificatie_Di02"), + ) + + m.post( + self.service.soap_service.url, + content=load_mock("voegZaakdocumentToe.xml"), + additional_matcher=match_text("edcLk01"), + ) + mock_task.id = 1 + + form_options = { + "zds_zaaktype_code": "zt-code", + "zds_zaaktype_omschrijving": "zt-omschrijving", + "zds_zaaktype_status_code": "123", + "zds_zaaktype_status_omschrijving": "aaabbc", + "zds_documenttype_omschrijving_inzending": "aaabbc", + } + + plugin = StufZDSRegistration("stuf") + serializer = plugin.configuration_options(data=form_options) + self.assertTrue(serializer.is_valid()) + + result = plugin.register_submission(submission, serializer.validated_data) + self.assertEqual( + result, + { + "zaak": "foo-zaak", + "document": "bar-document", + }, + ) + + xml_doc = xml_from_request_history(m, 0) + self.assertSoapXMLCommon(xml_doc) + + # extraElementen + self.assertXPathEquals( + xml_doc, + "//stuf:extraElementen/stuf:extraElement[@naam='extra_number']", + "2023", + ) diff --git a/src/stuf/stuf_zds/templates/stuf_zds/soap/creeerZaak.xml b/src/stuf/stuf_zds/templates/stuf_zds/soap/creeerZaak.xml index 2d620159e5..153c4e5847 100644 --- a/src/stuf/stuf_zds/templates/stuf_zds/soap/creeerZaak.xml +++ b/src/stuf/stuf_zds/templates/stuf_zds/soap/creeerZaak.xml @@ -1,4 +1,4 @@ -{% extends "stuf/soap_envelope.xml" %}{% load stuf l10n %} +{% extends "stuf/soap_envelope.xml" %}{% load stuf %} {% block body %} {# Parent template already defines some common namespaces #} {{ locatie.key }} - {{ locatie.lat|unlocalize }} {{ locatie.lng|unlocalize }} + {{ locatie.lat }} {{ locatie.lng }} diff --git a/src/stuf/templates/stuf/soap_envelope.xml b/src/stuf/templates/stuf/soap_envelope.xml index 9d1aced88d..81c265481c 100644 --- a/src/stuf/templates/stuf/soap_envelope.xml +++ b/src/stuf/templates/stuf/soap_envelope.xml @@ -1,4 +1,4 @@ -{% load stuf %} +{% load stuf l10n %} - {% block body %}{% endblock %} + {% localize off %}{% block body %}{% endblock %}{% endlocalize %}