From 88d411ba78a550fddce694d300f80ad098ff5d9e Mon Sep 17 00:00:00 2001 From: Viicos <65306057+Viicos@users.noreply.github.com> Date: Wed, 3 Apr 2024 16:22:33 +0200 Subject: [PATCH] [#4009] Remove tests related to merged data --- src/openforms/submissions/mapping.py | 28 +++++++++++ src/openforms/submissions/tests/test_admin.py | 46 +------------------ 2 files changed, 29 insertions(+), 45 deletions(-) diff --git a/src/openforms/submissions/mapping.py b/src/openforms/submissions/mapping.py index 900ddcdfed..5524660162 100644 --- a/src/openforms/submissions/mapping.py +++ b/src/openforms/submissions/mapping.py @@ -164,3 +164,31 @@ def get_component(submission, registration_attribute: str, component_attribute: attribute = glom(component, component_attribute, default=None) if attribute == registration_attribute: return component + + +from typing import Annotated, TypeVar + +T = TypeVar("T") + + +def field(default_factory): + return default_factory + + +WithDefaultFactory = Annotated[T, ...] + + +class Impl: + def __class_getitem__(cls, arg): + return Annotated[arg, field(default_factory=int)] + + +from dataclasses import dataclass + + +@dataclass +class A: + el: WithDefaultFactory[int] + + +A(el=1) diff --git a/src/openforms/submissions/tests/test_admin.py b/src/openforms/submissions/tests/test_admin.py index c6239978e2..9ce7238019 100644 --- a/src/openforms/submissions/tests/test_admin.py +++ b/src/openforms/submissions/tests/test_admin.py @@ -7,13 +7,12 @@ from maykin_2fa.test import disable_admin_mfa from openforms.accounts.tests.factories import UserFactory -from openforms.forms.models import FormVariable from openforms.logging.logevent import submission_start from openforms.logging.models import TimelineLogProxy from ...config.models import GlobalConfiguration from ..constants import PostSubmissionEvents, RegistrationStatuses -from .factories import SubmissionFactory, SubmissionValueVariableFactory +from .factories import SubmissionFactory @disable_admin_mfa() @@ -42,49 +41,6 @@ def setUp(self): super().setUp() self.user = UserFactory.create(is_superuser=True, is_staff=True) - def test_displaying_merged_data_formio_formatters(self): - response = self.app.get( - reverse( - "admin:submissions_submission_change", args=(self.submission_1.pk,) - ), - user=self.user, - ) - expected = """ - - """ - - self.assertContains(response, expected, html=True) - - def test_displaying_merged_data_displays_signature_as_image_formio_formatters(self): - form_variable = FormVariable.objects.get( - key="signature", form=self.submission_1.form - ) - SubmissionValueVariableFactory.create( - key="signature", - submission=self.submission_1, - value="data:image/png;base64,iVBOR", - form_variable=form_variable, - ) - - response = self.app.get( - reverse( - "admin:submissions_submission_change", args=(self.submission_1.pk,) - ), - user=self.user, - ) - - self.assertContains( - response, - "
  • signature: signature
  • ", - html=True, - ) - def test_viewing_submission_details_in_admin_creates_log(self): self.app.get( reverse(