Skip to content

Commit 26e9bfe

Browse files
committed
Update tests
1 parent c953f00 commit 26e9bfe

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/tests/test_tags.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_falsey_default_html_overide(self):
5151

5252

5353
class TagsTestFailCase(SimpleTestCase):
54-
def test_bad_default_html_warning(self):
54+
def test_bad_default_html_warning_on_older_django_versions(self):
5555
"""
5656
Test that the library raises a warning when passing a non-string `default_html` argument to `override_tag`
5757
in Django < 4.0
@@ -79,13 +79,13 @@ def test_bad_default_html_warning(self):
7979
str(cm.warnings[0]),
8080
)
8181

82-
def test_bad_default_html_error(self):
82+
def test_bad_default_html_warning_on_newer_django_versions(self):
8383
"""
84-
Test that the library raises a TypeError when passing a non-string `default_html` argument to `override_tag`
84+
Test that the library raises a warning when passing a non-string `default_html` argument to `override_tag`
8585
in Django >= 4.0
8686
"""
8787
with patch("django.VERSION", (4, 2, 0, "final", 0)):
88-
with self.assertRaises(TypeError) as cm:
88+
with self.assertWarns(Warning) as cm:
8989
template_name = (
9090
"patterns/atoms/tags_test_atom/invalid_tags_test_atom.html.fail"
9191
)
@@ -97,5 +97,5 @@ def test_bad_default_html_error(self):
9797
)
9898
self.assertIn(
9999
"default_html argument to override_tag must be a string",
100-
str(cm.exception),
100+
str(cm.warnings[0]),
101101
)

0 commit comments

Comments
 (0)