summaryrefslogtreecommitdiff
path: root/django/test/html.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-07-21 10:00:10 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-08-07 12:00:22 +0200
commitc5ef65bcf324f4c90b53be90f4aec069a68e8c59 (patch)
treebb9a4988fbae4e7366cc578ca845c49003cdcd64 /django/test/html.py
parentee191715eae73362768184aa95206cf61bac5d38 (diff)
[py3] Ported django.utils.encoding.
* Renamed smart_unicode to smart_text (but kept the old name under Python 2 for backwards compatibility). * Renamed smart_str to smart_bytes. * Re-introduced smart_str as an alias for smart_text under Python 3 and smart_bytes under Python 2 (which is backwards compatible). Thus smart_str always returns a str objects. * Used the new smart_str in a few places where both Python 2 and 3 want a str.
Diffstat (limited to 'django/test/html.py')
-rw-r--r--django/test/html.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/test/html.py b/django/test/html.py
index 2a1421bf17..143c3728be 100644
--- a/django/test/html.py
+++ b/django/test/html.py
@@ -5,7 +5,7 @@ Comparing two html documents.
from __future__ import unicode_literals
import re
-from django.utils.encoding import force_unicode
+from django.utils.encoding import force_text
from django.utils.html_parser import HTMLParser, HTMLParseError
from django.utils import six
@@ -25,7 +25,7 @@ class Element(object):
def append(self, element):
if isinstance(element, six.string_types):
- element = force_unicode(element)
+ element = force_text(element)
element = normalize_whitespace(element)
if self.children:
if isinstance(self.children[-1], six.string_types):