Commit ae1c0a7d by Karsa Zoltán István

unicode

parent 094a0230
......@@ -540,13 +540,13 @@ def fetch_human_exception(exception, user=None):
>>> r = humanize_exception("foo", Exception())
>>> fetch_human_exception(r, User())
u'foo'
'foo'
>>> fetch_human_exception(r).get_text(User())
u'foo'
'foo'
>>> fetch_human_exception(Exception(), User())
u'Unknown error'
'Unknown error'
>>> fetch_human_exception(PermissionDenied(), User())
u'Permission Denied'
'Permission Denied'
"""
if not isinstance(exception, HumanReadableException):
......
......@@ -660,7 +660,8 @@ class UserFactory(Factory):
''' using the excellent factory_boy library '''
class Meta:
model = User
username = Sequence(lambda i: 'test%d' % i)
username = Sequence(lambda i: 'test{}'.format(i))
first_name = 'John'
last_name = 'Doe'
email = Sequence(lambda i: 'test%d@example.com' % i)
email = Sequence(lambda i: 'test{}@example.com'.format(i))
......@@ -60,7 +60,7 @@ def connect_command_template_validator(value):
>>> try: connect_command_template_validator("%(host)s %s")
... except ValidationError as e: print(e)
...
[u'Invalid template string.']
['Invalid template string.']
"""
try:
......
......@@ -35,7 +35,7 @@ except NameError:
def highlight(field, q, none_wo_match=True):
"""
>>> highlight('<b>Akkount Krokodil', 'kro', False)
u'&lt;b&gt;Akkount <span class="autocomplete-hl">Kro</span>kodil'
'&lt;b&gt;Akkount <span class="autocomplete-hl">Kro</span>kodil'
"""
if not field:
......
......@@ -142,16 +142,16 @@ class FilterMixin(object):
>>> f = FilterMixin()
>>> o = list(f._parse_get({'s': "hello"}).items())
>>> sorted(o) # doctest: +ELLIPSIS
[(u'name', u'hello'), (...)]
[('name', 'hello'), (...)]
>>> o = list(f._parse_get({'s': "name:hello owner:test"}).items())
>>> sorted(o) # doctest: +ELLIPSIS
[(u'name', u'hello'), (u'owner', u'test'), (...)]
[('name', 'hello'), ('owner', 'test'), (...)]
>>> o = list(f._parse_get({'s': "name:hello ws node:node 3 oh"}).items())
>>> sorted(o) # doctest: +ELLIPSIS
[(u'name', u'hello ws'), (u'node', u'node 3 oh'), (...)]
[('name', 'hello ws'), ('node', 'node 3 oh'), (...)]
>>> o = list(f._parse_get({'s': "!hello:szia"}).items())
>>> sorted(o) # doctest: +ELLIPSIS
[(u'!hello', u'szia'), (...)]
[('!hello', 'szia'), (...)]
"""
s = GET_dict.get("s")
fake = GET_dict.copy()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment