From 53e3ee37afed9563e2df75f9d5bc6440f2f3a542 Mon Sep 17 00:00:00 2001 From: Anders <6058745+ddabble@users.noreply.github.com> Date: Thu, 23 Jan 2025 20:25:27 +0100 Subject: [PATCH 1/2] Removed the deprecated simple_history_admin_list This was deprecated in 16b7de7482d0898c9f83c9042c01442fe35ba66e. --- CHANGES.rst | 7 +++++++ .../templatetags/simple_history_admin_list.py | 15 --------------- simple_history/tests/tests/test_deprecation.py | 15 ++++++--------- 3 files changed, 13 insertions(+), 24 deletions(-) delete mode 100644 simple_history/templatetags/simple_history_admin_list.py diff --git a/CHANGES.rst b/CHANGES.rst index ba6ee45b2..f89e50035 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,13 @@ Changes Unreleased ---------- + +3.8.1 (2025-01-24) +------------------ + +- Removed the ``simple_history_admin_list.display_list()`` template tag that was + deprecated in version 3.6.0 (gh-1444) + 3.8.0 (2025-01-23) ------------------ diff --git a/simple_history/templatetags/simple_history_admin_list.py b/simple_history/templatetags/simple_history_admin_list.py deleted file mode 100644 index b6546784c..000000000 --- a/simple_history/templatetags/simple_history_admin_list.py +++ /dev/null @@ -1,15 +0,0 @@ -import warnings - -from django import template - -register = template.Library() - - -@register.inclusion_tag("simple_history/object_history_list.html", takes_context=True) -def display_list(context): - warnings.warn( - "'include' the context variable 'object_history_list_template' instead." - " This will be removed in version 3.8.", - DeprecationWarning, - ) - return context diff --git a/simple_history/tests/tests/test_deprecation.py b/simple_history/tests/tests/test_deprecation.py index 7c8ca9990..0bfb5e452 100644 --- a/simple_history/tests/tests/test_deprecation.py +++ b/simple_history/tests/tests/test_deprecation.py @@ -1,13 +1,10 @@ import unittest -from simple_history import __version__ -from simple_history.templatetags.simple_history_admin_list import display_list - class DeprecationWarningTest(unittest.TestCase): - def test__display_list__warns_deprecation_and_is_yet_to_be_removed(self): - with self.assertWarns(DeprecationWarning): - display_list({}) - # DEV: `display_list()` (and the file `simple_history_admin_list.py`) should be - # removed when 3.8 is released - self.assertLess(__version__, "3.8") + """Tests that check whether ``DeprecationWarning`` is raised for certain features, + and that compare ``simple_history.__version__`` against the version the features + will be removed in. + + If this class is empty, it normally means that nothing is currently deprecated. + """ From 94074030aad79535da98793cd7682756a50a35ae Mon Sep 17 00:00:00 2001 From: Anders <6058745+ddabble@users.noreply.github.com> Date: Sun, 26 Jan 2025 15:46:23 +0100 Subject: [PATCH 2/2] Updated release notes for removing display_list() --- CHANGES.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index f89e50035..f1aae5de8 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,7 @@ Unreleased ---------- -3.8.1 (2025-01-24) +3.9.0 (2025-01-26) ------------------ - Removed the ``simple_history_admin_list.display_list()`` template tag that was @@ -26,6 +26,8 @@ Unreleased - Fixed issue with history button not working when viewing historical entries in the admin (gh-527) - Added support for Django 5.2 (gh-1441) +- ``simple_history_admin_list.display_list()`` *was planned to be removed in this + release, but it was overlooked, and will instead be removed in 3.9.0* 3.7.0 (2024-05-29) ------------------