-
-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecated simple_history_admin_list.display_list
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
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") |