-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #583 from azmeuk/issue-581
Ascending compatibility with markupsafe
- Loading branch information
Showing
4 changed files
with
49 additions
and
2 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,21 @@ | ||
import warnings | ||
import unittest | ||
|
||
from wtforms.widgets import HTMLString, escape_html | ||
import markupsafe | ||
|
||
|
||
class DeprecationTest(unittest.TestCase): | ||
def test_htmlstring(self): | ||
with warnings.catch_warnings(record=True) as w: | ||
warnings.simplefilter("always") | ||
self.assertEqual(markupsafe.Markup("foobar"), HTMLString("foobar")) | ||
self.assertEqual(len(w), 1) | ||
assert issubclass(w[-1].category, DeprecationWarning) | ||
|
||
def test_escape(self): | ||
with warnings.catch_warnings(record=True) as w: | ||
warnings.simplefilter("always") | ||
self.assertEqual(markupsafe.escape("foobar"), escape_html("foobar")) | ||
self.assertEqual(len(w), 1) | ||
assert issubclass(w[-1].category, DeprecationWarning) |
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