Commit ae1c0a7d by Karsa Zoltán István

unicode

parent 094a0230
...@@ -540,13 +540,13 @@ def fetch_human_exception(exception, user=None): ...@@ -540,13 +540,13 @@ def fetch_human_exception(exception, user=None):
>>> r = humanize_exception("foo", Exception()) >>> r = humanize_exception("foo", Exception())
>>> fetch_human_exception(r, User()) >>> fetch_human_exception(r, User())
u'foo' 'foo'
>>> fetch_human_exception(r).get_text(User()) >>> fetch_human_exception(r).get_text(User())
u'foo' 'foo'
>>> fetch_human_exception(Exception(), User()) >>> fetch_human_exception(Exception(), User())
u'Unknown error' 'Unknown error'
>>> fetch_human_exception(PermissionDenied(), User()) >>> fetch_human_exception(PermissionDenied(), User())
u'Permission Denied' 'Permission Denied'
""" """
if not isinstance(exception, HumanReadableException): if not isinstance(exception, HumanReadableException):
......
...@@ -660,7 +660,8 @@ class UserFactory(Factory): ...@@ -660,7 +660,8 @@ class UserFactory(Factory):
''' using the excellent factory_boy library ''' ''' using the excellent factory_boy library '''
class Meta: class Meta:
model = User model = User
username = Sequence(lambda i: 'test%d' % i) username = Sequence(lambda i: 'test{}'.format(i))
first_name = 'John' first_name = 'John'
last_name = 'Doe' 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): ...@@ -60,7 +60,7 @@ def connect_command_template_validator(value):
>>> try: connect_command_template_validator("%(host)s %s") >>> try: connect_command_template_validator("%(host)s %s")
... except ValidationError as e: print(e) ... except ValidationError as e: print(e)
... ...
[u'Invalid template string.'] ['Invalid template string.']
""" """
try: try:
......
...@@ -35,7 +35,7 @@ except NameError: ...@@ -35,7 +35,7 @@ except NameError:
def highlight(field, q, none_wo_match=True): def highlight(field, q, none_wo_match=True):
""" """
>>> highlight('<b>Akkount Krokodil', 'kro', False) >>> 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: if not field:
......
...@@ -142,16 +142,16 @@ class FilterMixin(object): ...@@ -142,16 +142,16 @@ class FilterMixin(object):
>>> f = FilterMixin() >>> f = FilterMixin()
>>> o = list(f._parse_get({'s': "hello"}).items()) >>> o = list(f._parse_get({'s': "hello"}).items())
>>> sorted(o) # doctest: +ELLIPSIS >>> sorted(o) # doctest: +ELLIPSIS
[(u'name', u'hello'), (...)] [('name', 'hello'), (...)]
>>> o = list(f._parse_get({'s': "name:hello owner:test"}).items()) >>> o = list(f._parse_get({'s': "name:hello owner:test"}).items())
>>> sorted(o) # doctest: +ELLIPSIS >>> 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()) >>> o = list(f._parse_get({'s': "name:hello ws node:node 3 oh"}).items())
>>> sorted(o) # doctest: +ELLIPSIS >>> 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()) >>> o = list(f._parse_get({'s': "!hello:szia"}).items())
>>> sorted(o) # doctest: +ELLIPSIS >>> sorted(o) # doctest: +ELLIPSIS
[(u'!hello', u'szia'), (...)] [('!hello', 'szia'), (...)]
""" """
s = GET_dict.get("s") s = GET_dict.get("s")
fake = GET_dict.copy() 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