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/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):