From dbb937613482139b396c4c7dcc8a538b7dc4d0f8 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 29 Oct 2023 16:22:12 -0500 Subject: [PATCH] Remove tests/helpers.py (unused) --- tests/helpers.py | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 tests/helpers.py diff --git a/tests/helpers.py b/tests/helpers.py deleted file mode 100644 index adb4d582..00000000 --- a/tests/helpers.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Tests for DocutilsView template view.""" -import typing as t - -from django.template.engine import Engine - -if t.TYPE_CHECKING: - import sys - import types - - from typing_extensions import TypeAlias - - # https://github.com/python/typeshed/blob/f7aa7b7/stdlib/builtins.pyi#L1461 - if sys.version_info >= (3, 10): - _ClassInfo: TypeAlias = type | types.UnionType | tuple["_ClassInfo", ...] - else: - _ClassInfo: TypeAlias = type | tuple[_ClassInfo, ...] - - -def get_template_engine( - using: "_ClassInfo", -) -> None | Engine: - """Return Template Engine (e.g. DocutilsTemplates), for augmenting dirs in tests.""" - from django.template import engines - - for engine in engines.all(): - if isinstance(engine, using): - return t.cast(Engine, engine.engine) # type:ignore - return None