diff --git a/src/openforms/conf/locale/nl/LC_MESSAGES/django.po b/src/openforms/conf/locale/nl/LC_MESSAGES/django.po index 9b8331c70d..423533d77c 100644 --- a/src/openforms/conf/locale/nl/LC_MESSAGES/django.po +++ b/src/openforms/conf/locale/nl/LC_MESSAGES/django.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Open Forms\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-17 15:19+0100\n" +"POT-Creation-Date: 2024-12-19 17:20+0100\n" "PO-Revision-Date: 2024-12-17 15:18+0100\n" "Last-Translator: Sergei Maertens \n" "Language-Team: Dutch \n" @@ -114,7 +114,7 @@ msgstr "" "De voorkeurstaal voor de (beheer) gebruikersinterface. Wanneer geen waarde " "ingesteld is, worden de browserinstellingen gebruikt." -#: openforms/accounts/models.py:81 openforms/forms/models/form.py:702 +#: openforms/accounts/models.py:81 openforms/forms/models/form.py:697 #: openforms/forms/models/form_version.py:64 soap/models.py:50 msgid "user" msgstr "gebruiker" @@ -1261,7 +1261,7 @@ msgstr "Tijdstip wanneer de afspraakdetails zijn gemaakt " msgid "Appointment information" msgstr "Afspraakinformatie" -#: openforms/appointments/models.py:112 openforms/authentication/models.py:30 +#: openforms/appointments/models.py:112 openforms/authentication/models.py:31 msgid "plugin" msgstr "plugin" @@ -1716,112 +1716,112 @@ msgstr "Doorgaan als medewerker" msgid "Use either BSN or KvK" msgstr "Geef een BSN of KvK-nummer op" -#: openforms/authentication/models.py:31 openforms/authentication/views.py:258 +#: openforms/authentication/models.py:32 openforms/authentication/views.py:258 msgid "Identifier of the authentication plugin." msgstr "Unieke identificatie van de authenticatieplugin" -#: openforms/authentication/models.py:35 +#: openforms/authentication/models.py:36 msgid "attribute" msgstr "attribuut" -#: openforms/authentication/models.py:36 +#: openforms/authentication/models.py:37 msgid "Name of the attribute returned by the authentication plugin." msgstr "Naam van het attribuut voorzien door de authenticatieplugin" -#: openforms/authentication/models.py:41 openforms/config/models/csp.py:62 +#: openforms/authentication/models.py:42 openforms/config/models/csp.py:62 #: openforms/submissions/models/submission_value_variable.py:325 #: openforms/validations/api/views.py:72 msgid "value" msgstr "waarde" -#: openforms/authentication/models.py:42 +#: openforms/authentication/models.py:43 msgid "Value of the attribute returned by the authentication plugin." msgstr "Waarde van het attribuut voorzien door de authenticatieplugin" -#: openforms/authentication/models.py:46 +#: openforms/authentication/models.py:47 msgid "identifying attributes hashed" msgstr "Identificerende attributen gehasht" -#: openforms/authentication/models.py:47 +#: openforms/authentication/models.py:48 msgid "Are the auth/identifying attributes hashed?" msgstr "Zijn de authenticatie-/identificerende gegevens gehasht?" -#: openforms/authentication/models.py:58 openforms/authentication/models.py:59 -#: openforms/authentication/models.py:217 +#: openforms/authentication/models.py:59 openforms/authentication/models.py:60 #: openforms/authentication/models.py:218 +#: openforms/authentication/models.py:219 msgid "Authentication details" msgstr "Authenticatiedetails" -#: openforms/authentication/models.py:133 -#: openforms/authentication/models.py:357 openforms/emails/constants.py:16 +#: openforms/authentication/models.py:134 +#: openforms/authentication/models.py:378 openforms/emails/constants.py:16 #: openforms/formio/api/serializers.py:33 #: openforms/submissions/api/serializers.py:587 msgid "Submission" msgstr "Inzending" -#: openforms/authentication/models.py:135 -#: openforms/authentication/models.py:359 +#: openforms/authentication/models.py:136 +#: openforms/authentication/models.py:380 msgid "Submission related to this authentication information" msgstr "Inzending waar deze authenticatiegegevens bijhoren" -#: openforms/authentication/models.py:147 +#: openforms/authentication/models.py:148 msgid "Level of assurance" msgstr "Betrouwbaarheidsniveau" -#: openforms/authentication/models.py:149 +#: openforms/authentication/models.py:150 msgid "" "How certain is the identity provider that this identity belongs to this user." msgstr "" "Indicatie van de mate van zekerheid over de identiteit van de gebruiker, " "afgegeven door de identity provider." -#: openforms/authentication/models.py:159 +#: openforms/authentication/models.py:160 msgid "acting subject identifier type" msgstr "identificatiesoort handelende persoon" -#: openforms/authentication/models.py:161 -#: openforms/authentication/models.py:177 +#: openforms/authentication/models.py:162 +#: openforms/authentication/models.py:178 msgid "The identifier type determines how to interpret the identifier value." msgstr "" "De identificatiesoort bepaalt hoe de identificatie geïnterpreteerd moet " "worden." -#: openforms/authentication/models.py:168 +#: openforms/authentication/models.py:169 msgid "acting subject identifier" msgstr "identificatie handelende persoon" -#: openforms/authentication/models.py:169 +#: openforms/authentication/models.py:170 msgid "(Contextually) unique identifier for the acting subject." msgstr "Unieke identificatie die de handelende persoon vaststelt." -#: openforms/authentication/models.py:175 +#: openforms/authentication/models.py:176 msgid "legal subject identifier type" msgstr "identificatiesoort (wettelijke) vertegenwoordiger" -#: openforms/authentication/models.py:184 +#: openforms/authentication/models.py:185 msgid "legal subject identifier" msgstr "identificatie (wettelijke) vertegenwoordiger" -#: openforms/authentication/models.py:185 +#: openforms/authentication/models.py:186 msgid "(Contextually) unique identifier for the legal subject." msgstr "Unieke identificatie die de (wettelijke) vertegenwoordiger bepaalt." -#: openforms/authentication/models.py:192 +#: openforms/authentication/models.py:193 msgid "legal subject service restriction" msgstr "dienstverleningbeperking (wettelijke) vertegenwoordiger" -#: openforms/authentication/models.py:194 +#: openforms/authentication/models.py:195 msgid "" "Optional service restriction information within the bigger legal subject." msgstr "" "Niet-verplichte beperking binnen de hele (wettelijke) vertegenwoordiger, " "bijvoorbeeld een vestigingsnummer." -#: openforms/authentication/models.py:201 +#: openforms/authentication/models.py:202 msgid "mandate context" msgstr "machtigingscontext" -#: openforms/authentication/models.py:203 +#: openforms/authentication/models.py:204 msgid "" "If a mandate is in play, then the mandate context must be provided. The " "details are tracked here, in line with the authentication context data JSON " @@ -1832,12 +1832,12 @@ msgstr "" "dat overeenkomt met het JSON Schema van het " "authenticatiecontextgegevensmodel." -#: openforms/authentication/models.py:364 -#: openforms/authentication/models.py:365 +#: openforms/authentication/models.py:385 +#: openforms/authentication/models.py:386 msgid "Registrator authentication details" msgstr "Authenticatiedetails van de registrator" -#: openforms/authentication/models.py:370 +#: openforms/authentication/models.py:391 msgid "Can register submission for customers" msgstr "Mag inzendingen opvoeren voor klanten" @@ -3158,7 +3158,7 @@ msgid "An easily recognizable name for the theme, used to identify it." msgstr "Een herkenbare naam om deze stijl te identificeren." #: openforms/config/models/theme.py:26 openforms/forms/models/category.py:10 -#: openforms/forms/models/form.py:58 openforms/forms/models/form.py:689 +#: openforms/forms/models/form.py:58 openforms/forms/models/form.py:684 #: openforms/forms/models/form_definition.py:39 #: openforms/forms/models/form_step.py:24 #: openforms/forms/models/form_version.py:44 openforms/forms/models/logic.py:11 @@ -3399,15 +3399,15 @@ msgstr "BRK API" msgid "Service for API interaction with the BRK." msgstr "Service voor interactie met de BRK-API." -#: openforms/contrib/brk/validators.py:45 +#: openforms/contrib/brk/validators.py:47 msgid "BRK - Zakelijk gerechtigd" msgstr "BRK - Zakelijk gerechtigd" -#: openforms/contrib/brk/validators.py:49 +#: openforms/contrib/brk/validators.py:51 msgid "No BSN is available to validate your address." msgstr "Er is geen BSN beschikbaar voor de adrescontrole." -#: openforms/contrib/brk/validators.py:51 +#: openforms/contrib/brk/validators.py:53 msgid "" "There was an error while retrieving the available properties. Please try " "again later." @@ -3415,12 +3415,12 @@ msgstr "" "Er deed zich een fout voor bij het opvragen van de beschikbare eigendommen. " "Gelieve het later opnieuw te proberen." -#: openforms/contrib/brk/validators.py:54 +#: openforms/contrib/brk/validators.py:56 msgid "According to our records, you are not a legal owner of this property." msgstr "" "Volgens onze gegevens ben je geen zakelijk gerechtigde op dit eigendom." -#: openforms/contrib/brk/validators.py:56 +#: openforms/contrib/brk/validators.py:58 msgid "No property found for this address." msgstr "Kon geen onroerend goed vinden voor dit adres." @@ -3924,7 +3924,7 @@ msgstr "Lijst van beschikbare documenttypen (Objecten API)" #: openforms/contrib/objects_api/apps.py:8 #: openforms/contrib/objects_api/models.py:29 -#: openforms/prefill/contrib/objects_api/plugin.py:29 +#: openforms/prefill/contrib/objects_api/plugin.py:28 msgid "Objects API" msgstr "Objecten API" @@ -5247,28 +5247,28 @@ msgstr "Bestandsgrootte" msgid "The provided file is not a valid file type." msgstr "Het bestand is geen toegestaan bestandstype." -#: openforms/formio/api/validators.py:97 openforms/formio/api/validators.py:116 +#: openforms/formio/api/validators.py:97 openforms/formio/api/validators.py:131 #, python-brace-format msgid "The provided file is not a {file_type}." msgstr "Het bestand is geen {file_type}." -#: openforms/formio/api/validators.py:142 +#: openforms/formio/api/validators.py:157 msgid "The virus scan could not be performed at this time. Please retry later." msgstr "" "Het is momenteel niet mogelijk om bestanden te scannen op virussen. Probeer " "het later opnieuw." -#: openforms/formio/api/validators.py:151 +#: openforms/formio/api/validators.py:166 #, python-brace-format msgid "" "File did not pass the virus scan. It was found to contain '{virus_name}'." msgstr "Er is een virus gedetecteerd in het bestand: '{virus_name}'." -#: openforms/formio/api/validators.py:157 +#: openforms/formio/api/validators.py:172 msgid "The virus scan on this file returned an error." msgstr "Er deed zich een onbekende fout voor bij het scannen op virussen." -#: openforms/formio/api/validators.py:169 +#: openforms/formio/api/validators.py:184 msgid "The virus scan returned an unexpected status." msgstr "De virusscan resulteerde in een onverwachte status." @@ -5377,66 +5377,58 @@ msgstr "De waarde is na de maximale tijd" msgid "Value is not between mininum and maximum time." msgstr "De waarde ligt niet tussen de minimale en maximale tijd." -#: openforms/formio/components/vanilla.py:344 -msgid "" -"Could not determine the file type. Please make sure the file name has an " -"extension." -msgstr "" -"Het bestandstype kon niet bepaald worden. Controleer of de bestandsnaam met " -"een extensie eindigt (bijvoorbeel '.pdf' of '.png')." - -#: openforms/formio/components/vanilla.py:365 +#: openforms/formio/components/vanilla.py:358 #, python-brace-format msgid "The value of {root_key} must match the value of {nested_key} in 'data'." msgstr "" "De waarde van {root_key} moet overeenkomen met de waarde van {nested_key} in " "'data'." -#: openforms/formio/components/vanilla.py:374 -#: openforms/formio/components/vanilla.py:387 +#: openforms/formio/components/vanilla.py:367 +#: openforms/formio/components/vanilla.py:380 msgid "Invalid URL." msgstr "Ongeldige URL." -#: openforms/formio/components/vanilla.py:378 +#: openforms/formio/components/vanilla.py:371 msgid "Size does not match the uploaded file." msgstr "De grootte komt niet overeen met de bestandsgrootte van de upload." -#: openforms/formio/components/vanilla.py:383 +#: openforms/formio/components/vanilla.py:376 msgid "Name does not match the uploaded file." msgstr "De bestandsnaam komt niet overeen met de upload." -#: openforms/formio/components/vanilla.py:508 +#: openforms/formio/components/vanilla.py:501 msgid "Checkbox must be checked." msgstr "Het selectievakje moet aangevinkt zijn." -#: openforms/formio/components/vanilla.py:539 +#: openforms/formio/components/vanilla.py:532 #, python-brace-format msgid "Ensure this field has at least {min_selected_count} checked options." msgstr "" "Zorg dat dit veld {min_selected_count} of meer opties aangevinkt heeft." -#: openforms/formio/components/vanilla.py:542 +#: openforms/formio/components/vanilla.py:535 #, python-brace-format msgid "" "Ensure this field has no more than {max_selected_count} checked options." msgstr "" "Zorg dat dit veld {max_selected_count} of minder opties aangevinkt heeft." -#: openforms/formio/components/vanilla.py:768 +#: openforms/formio/components/vanilla.py:761 #, python-brace-format msgid "Expected a list of items but got type \"{input_type}\"." msgstr "Een lijst van waarden was verwacht, maar kreeg \"{input_type}\"." -#: openforms/formio/components/vanilla.py:769 +#: openforms/formio/components/vanilla.py:762 msgid "This list may not be empty." msgstr "De lijst mag niet leeg zijn." -#: openforms/formio/components/vanilla.py:770 +#: openforms/formio/components/vanilla.py:763 #, python-brace-format msgid "Ensure this field has at least {min_length} elements." msgstr "Zorg dat dit veld {min_length} of meer waarden heeft." -#: openforms/formio/components/vanilla.py:771 +#: openforms/formio/components/vanilla.py:764 #, python-brace-format msgid "Ensure this field has no more than {max_length} elements." msgstr "Zorg dat dit veld {max_length} of minder waarden heeft." @@ -6872,35 +6864,35 @@ msgstr "{slug}-kopie" msgid "Restored form version {version} (from {created})." msgstr "Formulierversie {version} hersteld (van {created})." -#: openforms/forms/models/form.py:691 +#: openforms/forms/models/form.py:686 msgid "export content" msgstr "Exportinhoud" -#: openforms/forms/models/form.py:693 +#: openforms/forms/models/form.py:688 msgid "Zip file containing all the exported forms." msgstr "Het ZIP-bestand met daarin alle geëxporteerde formulieren." -#: openforms/forms/models/form.py:696 +#: openforms/forms/models/form.py:691 msgid "date time requested" msgstr "Moment van aanvraag" -#: openforms/forms/models/form.py:697 +#: openforms/forms/models/form.py:692 msgid "The date and time on which the bulk export was requested." msgstr "De datum en tijdstip waarop de bulk export aangevraagd is." -#: openforms/forms/models/form.py:703 +#: openforms/forms/models/form.py:698 msgid "The user that requested the download." msgstr "De gebruiker die de download heeft aangevraagd." -#: openforms/forms/models/form.py:710 +#: openforms/forms/models/form.py:705 msgid "forms export" msgstr "formulierenexport" -#: openforms/forms/models/form.py:711 +#: openforms/forms/models/form.py:706 msgid "forms exports" msgstr "Formulierexports" -#: openforms/forms/models/form.py:714 +#: openforms/forms/models/form.py:709 #, python-format msgid "Bulk export requested by %(username)s on %(datetime)s" msgstr "Bulk-export aangevraagd door %(username)s op %(datetime)s" @@ -9363,17 +9355,12 @@ msgstr "Lijst van beschikbare attributen voor de Objecten API" msgid "Objects API prefill plugin" msgstr "Objecten-API prefill-plugin" -#: openforms/prefill/contrib/objects_api/plugin.py:75 +#: openforms/prefill/contrib/objects_api/plugin.py:74 #: openforms/registrations/contrib/objects_api/plugin.py:134 -#: openforms/registrations/contrib/zgw_apis/plugin.py:612 +#: openforms/registrations/contrib/zgw_apis/plugin.py:613 msgid "Manage API groups" msgstr "API-groepen beheren" -#: openforms/prefill/contrib/objects_api/plugin.py:81 -#: openforms/registrations/contrib/objects_api/plugin.py:138 -msgid "Defaults configuration" -msgstr "Standaardinstellingen" - #: openforms/prefill/contrib/stufbg/apps.py:8 msgid "StUF-BG prefill plugin" msgstr "StUF-BG prefillplugin" @@ -10308,6 +10295,10 @@ msgstr "" msgid "Objects API registration" msgstr "Objecten API registratie" +#: openforms/registrations/contrib/objects_api/plugin.py:138 +msgid "Defaults configuration" +msgstr "Standaardinstellingen" + #: openforms/registrations/contrib/objects_api/registration_variables.py:31 #: openforms/submissions/api/serializers.py:446 msgid "Public reference" @@ -10798,11 +10789,11 @@ msgid "Could not find a roltype with this description related to the zaaktype." msgstr "" "Kon geen roltype vinden met deze omschrijving binnen het opgegeven zaaktype." -#: openforms/registrations/contrib/zgw_apis/plugin.py:172 +#: openforms/registrations/contrib/zgw_apis/plugin.py:173 msgid "ZGW API's" msgstr "ZGW API's" -#: openforms/registrations/contrib/zgw_apis/plugin.py:414 +#: openforms/registrations/contrib/zgw_apis/plugin.py:415 msgid "Employee who registered the case on behalf of the customer." msgstr "Medewerker die de zaak registreerde voor de klant." @@ -13627,3 +13618,10 @@ msgstr "" msgid "Without any binding addresses, no Suwinet service can be used." msgstr "" "Zonder enig \"binding address\" kan er geen Suwinet service gebruikt worden." + +#~ msgid "" +#~ "Could not determine the file type. Please make sure the file name has an " +#~ "extension." +#~ msgstr "" +#~ "Het bestandstype kon niet bepaald worden. Controleer of de bestandsnaam " +#~ "met een extensie eindigt (bijvoorbeel '.pdf' of '.png')." diff --git a/src/openforms/formio/api/validators.py b/src/openforms/formio/api/validators.py index 34dcd5aa13..82f9aa5caf 100644 --- a/src/openforms/formio/api/validators.py +++ b/src/openforms/formio/api/validators.py @@ -56,7 +56,8 @@ def __init__(self, allowed_mime_types: Iterable[str] | None = None): def __call__(self, value: UploadedFile) -> None: head = value.read(2048) - ext = value.name.split(".")[-1] + file_name_parts = value.name.split(".") + ext = file_name_parts[-1] mime_type = magic.from_buffer(head, mime=True) # gh #2520 @@ -76,6 +77,14 @@ def __call__(self, value: UploadedFile) -> None: _("The provided file is not a valid file type.") ) + if len(file_name_parts) == 1: + raise serializers.ValidationError( + _( + "Could not determine the file type. Please make sure the file name " + "has an extension." + ) + ) + # Contents is allowed. Do extension or submitted content_type agree? if value.content_type == "application/octet-stream": m = magic.Magic(extension=True) @@ -111,6 +120,11 @@ def __call__(self, value: UploadedFile) -> None: "image/heif", ): return + # 4795 + # The sdk cannot determine the file type of .msg files, which result into + # content_type "". So we have to validate these for ourselves + elif mime_type == "application/vnd.ms-outlook" and ext == "msg": + return # gh #4658 # Windows use application/x-zip-compressed as a mimetype for .zip files, which diff --git a/src/openforms/formio/components/vanilla.py b/src/openforms/formio/components/vanilla.py index 109cb0560d..d5e6a7937a 100644 --- a/src/openforms/formio/components/vanilla.py +++ b/src/openforms/formio/components/vanilla.py @@ -338,14 +338,7 @@ class FileSerializer(serializers.Serializer): originalName = serializers.CharField(trim_whitespace=False) size = serializers.IntegerField(min_value=0) storage = serializers.ChoiceField(choices=["url"]) - type = serializers.CharField( - error_messages={ - "blank": _( - "Could not determine the file type. Please make sure the file name " - "has an extension." - ), - } - ) + type = serializers.CharField(required=False, allow_blank=True) url = serializers.URLField() data = FileDataSerializer() # type: ignore diff --git a/src/openforms/formio/tests/files/test.msg b/src/openforms/formio/tests/files/test.msg new file mode 100644 index 0000000000..b597796de6 Binary files /dev/null and b/src/openforms/formio/tests/files/test.msg differ diff --git a/src/openforms/formio/tests/test_validators.py b/src/openforms/formio/tests/test_validators.py index f0d0671d25..93f73fc98e 100644 --- a/src/openforms/formio/tests/test_validators.py +++ b/src/openforms/formio/tests/test_validators.py @@ -202,6 +202,22 @@ def test_allowed_mime_types_for_csv_files(self): validator(sample) + def test_allowed_mime_types_for_msg_files(self): + valid_type = "application/vnd.ms-outlook" + msg_file = TEST_FILES / "test.msg" + validator = validators.MimeTypeValidator(allowed_mime_types=[valid_type]) + + # 4795 + # The sdk cannot determine the content_type for .msg files correctly. + # Because .msg is a windows specific file, and linux and MacOS don't know it. + # So we simulate the scenario where content_type is unknown + sample = SimpleUploadedFile( + "test.msg", + msg_file.read_bytes(), + ) + + validator(sample) + def test_validate_files_multiple_mime_types(self): """Assert that validation of files associated with multiple mime types works diff --git a/src/openforms/formio/tests/validation/test_file.py b/src/openforms/formio/tests/validation/test_file.py index c656687d5f..61470f6696 100644 --- a/src/openforms/formio/tests/validation/test_file.py +++ b/src/openforms/formio/tests/validation/test_file.py @@ -602,10 +602,10 @@ def test_attach_upload_validates_unknown_file_type(self): } is_valid, errors = validate_formio_data(component, data, submission=submission) - error = extract_error(errors["foo"][0], "type") + error = extract_error(errors["foo"][0], "non_field_errors") self.assertFalse(is_valid) - self.assertEqual(error.code, "blank") + self.assertEqual(error.code, "invalid") self.assertEqual( error, _( diff --git a/src/openforms/tests/e2e/data/test.msg b/src/openforms/tests/e2e/data/test.msg new file mode 100644 index 0000000000..b597796de6 Binary files /dev/null and b/src/openforms/tests/e2e/data/test.msg differ diff --git a/src/openforms/tests/e2e/test_file_upload.py b/src/openforms/tests/e2e/test_file_upload.py index f0001aa773..bd6be71435 100644 --- a/src/openforms/tests/e2e/test_file_upload.py +++ b/src/openforms/tests/e2e/test_file_upload.py @@ -77,3 +77,64 @@ def setUpTestData(): await expect( page.get_by_text("Een moment geduld", exact=False) ).to_be_visible() + + async def test_form_with_msg_file_upload(self): + # If using the ci.py settings locally, the SDK_RELEASE variable should be set to 'latest', otherwise the + # JS/CSS for the SDK will not be found (since they will be expected to be in the folder + # openforms/static/sdk/ instead of openforms/static/sdk + @sync_to_async + def setUpTestData(): + # set up a form + form = FormFactory.create( + name="Form with file upload", + slug="form-with-file-upload", + generate_minimal_setup=True, + formstep__form_definition__name="First step", + formstep__form_definition__slug="first-step", + formstep__form_definition__configuration={ + "components": [ + { + "type": "file", + "key": "fileUpload", + "label": "File Upload", + "storage": "url", + "validate": { + "required": True, + }, + } + ] + }, + translation_enabled=False, # force Dutch + ask_privacy_consent=False, + ask_statement_of_truth=False, + ) + return form + + form = await setUpTestData() + form_url = str( + furl(self.live_server_url) + / reverse("forms:form-detail", kwargs={"slug": form.slug}) + ) + + with patch("openforms.utils.validators.allow_redirect_url", return_value=True): + async with browser_page() as page: + await page.goto(form_url) + + await page.get_by_role("button", name="Formulier starten").click() + + async with page.expect_file_chooser() as fc_info: + await page.get_by_text("blader").click() + + file_chooser = await fc_info.value + await file_chooser.set_files(TEST_FILES / "test.msg") + + await page.wait_for_load_state("networkidle") + + uploaded_file = page.get_by_role("link", name="test.msg") + await expect(uploaded_file).to_be_visible() + + await page.get_by_role("button", name="Volgende").click() + await page.get_by_role("button", name="Verzenden").click() + await expect( + page.get_by_text("Een moment geduld", exact=False) + ).to_be_visible() diff --git a/src/openforms/tests/e2e/test_input_validation.py b/src/openforms/tests/e2e/test_input_validation.py index 8dbc9f4830..ba0320fe22 100644 --- a/src/openforms/tests/e2e/test_input_validation.py +++ b/src/openforms/tests/e2e/test_input_validation.py @@ -940,7 +940,7 @@ def test_unknown_file_type(self): # The frontend validation will *not* create a TemporaryFileUpload, # as the frontend will block the upload because of the invalid file type. # However the user could do an handcrafted API call. - # For this reason, we manually create an invalid TemporaryFileUpload + # For this reason, we manually try to create an invalid TemporaryFileUpload # and use it for the `api_value`: with open(TEST_FILES / "unknown-type", "rb") as infile: @@ -966,8 +966,8 @@ def test_unknown_file_type(self): ], ) - # Make sure the frontend did not create one: - self.assertEqual(TemporaryFileUpload.objects.count(), 1) + # Make sure that no temporary files were created + self.assertEqual(TemporaryFileUpload.objects.count(), 0) class SingleAddressNLTests(ValidationsTestCase):