""" Tests for template_partials integration with django-components. See https://github.com/django-components/django-components/issues/1327 and https://github.com/django-components/django-components/issues/1323. This file can be deleted after Django 5.2 reached end of life. See https://github.com/django-components/django-components/issues/1323#issuecomment-3163478287. """ from typing import NamedTuple import pytest from django.shortcuts import render from django.http import HttpRequest from django_components import Component, register from django_components.testing import djc_test from .testutils import setup_test_config try: from template_partials.templatetags.partials import TemplateProxy except ImportError: TemplateProxy = None setup_test_config(components={"autodiscover": False}) # See https://github.com/django-components/django-components/issues/1323#issuecomment-3156654329 @djc_test( django_settings={"INSTALLED_APPS": ("template_partials", "django_components", "tests.test_app")} ) class TestTemplatePartialsIntegration: @pytest.mark.skipif(TemplateProxy is None, reason="template_partials not available") def test_render_partial(self): @register("calendar") class Calendar(Component): template = """