|
18 | 18 | from django.utils.safestring import mark_safe, SafeData |
19 | 19 | from django.utils.html import strip_tags |
20 | 20 | from django.utils.encoding import force_text |
| 21 | +from django.utils.encoding import force_str # pyflakes:ignore force_str is used in the doctests |
21 | 22 |
|
22 | 23 | import debug # pyflakes:ignore |
23 | 24 |
|
@@ -51,17 +52,17 @@ def parse_email_list(value): |
51 | 52 |
|
52 | 53 | Splitting a string of email addresses should return a list: |
53 | 54 |
|
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')) |
55 | 56 | '<a href="mailto:joe@example.org">joe@example.org</a>, <a href="mailto:fred@example.com">fred@example.com</a>' |
56 | 57 |
|
57 | 58 | Parsing a non-string should return the input value, rather than fail: |
58 | 59 |
|
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']) ] |
60 | 61 | ['joe@example.org', 'fred@example.com'] |
61 | 62 |
|
62 | 63 | Null input values should pass through silently: |
63 | 64 |
|
64 | | - >>> six.ensure_str(parse_email_list('')) |
| 65 | + >>> force_str(parse_email_list('')) |
65 | 66 | '' |
66 | 67 |
|
67 | 68 | >>> parse_email_list(None) |
@@ -102,7 +103,7 @@ def make_one_per_line(value): |
102 | 103 | """ |
103 | 104 | Turn a comma-separated list into a carriage-return-seperated list. |
104 | 105 |
|
105 | | - >>> six.ensure_str(make_one_per_line("a, b, c")) |
| 106 | + >>> force_str(make_one_per_line("a, b, c")) |
106 | 107 | 'a\\nb\\nc' |
107 | 108 |
|
108 | 109 | Pass through non-strings: |
|
0 commit comments