Python django.utils.text.unescape_entities() Examples

The following are 2 code examples of django.utils.text.unescape_entities(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django.utils.text , or try the search function .
Example #1
Source File: test_text.py    From djongo with GNU Affero General Public License v3.0 5 votes vote down vote up
def test_unescape_entities(self):
        items = [
            ('', ''),
            ('foo', 'foo'),
            ('&', '&'),
            ('&', '&'),
            ('&', '&'),
            ('foo & bar', 'foo & bar'),
            ('foo & bar', 'foo & bar'),
        ]
        for value, output in items:
            self.assertEqual(text.unescape_entities(value), output)
            self.assertEqual(text.unescape_entities(lazystr(value)), output) 
Example #2
Source File: test_text.py    From djongo with GNU Affero General Public License v3.0 5 votes vote down vote up
def test_unescape_entities(self):
        items = [
            ('', ''),
            ('foo', 'foo'),
            ('&', '&'),
            ('&', '&'),
            ('&', '&'),
            ('foo & bar', 'foo & bar'),
            ('foo & bar', 'foo & bar'),
        ]
        for value, output in items:
            self.assertEqual(text.unescape_entities(value), output)
            self.assertEqual(text.unescape_entities(lazystr(value)), output)