Skip to content

Commit bbff4b0

Browse files
committed
Replaced six.ensure_str with django's force_str
- Legacy-Id: 16513
1 parent 57e16bf commit bbff4b0

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

ietf/doc/templatetags/ietf_filters.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from django.utils.safestring import mark_safe, SafeData
1919
from django.utils.html import strip_tags
2020
from django.utils.encoding import force_text
21+
from django.utils.encoding import force_str # pyflakes:ignore force_str is used in the doctests
2122

2223
import debug # pyflakes:ignore
2324

@@ -51,17 +52,17 @@ def parse_email_list(value):
5152
5253
Splitting a string of email addresses should return a list:
5354
54-
>>> six.ensure_str(parse_email_list('joe@example.org, fred@example.com'))
55+
>>> force_str(parse_email_list('joe@example.org, fred@example.com'))
5556
'<a href="mailto:joe@example.org">joe@example.org</a>, <a href="mailto:fred@example.com">fred@example.com</a>'
5657
5758
Parsing a non-string should return the input value, rather than fail:
5859
59-
>>> [ six.ensure_str(e) for e in parse_email_list(['joe@example.org', 'fred@example.com']) ]
60+
>>> [ force_str(e) for e in parse_email_list(['joe@example.org', 'fred@example.com']) ]
6061
['joe@example.org', 'fred@example.com']
6162
6263
Null input values should pass through silently:
6364
64-
>>> six.ensure_str(parse_email_list(''))
65+
>>> force_str(parse_email_list(''))
6566
''
6667
6768
>>> parse_email_list(None)
@@ -102,7 +103,7 @@ def make_one_per_line(value):
102103
"""
103104
Turn a comma-separated list into a carriage-return-seperated list.
104105
105-
>>> six.ensure_str(make_one_per_line("a, b, c"))
106+
>>> force_str(make_one_per_line("a, b, c"))
106107
'a\\nb\\nc'
107108
108109
Pass through non-strings:

0 commit comments

Comments
 (0)