Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
5
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ae1c0a7d
authored
Feb 19, 2022
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unicode
parent
094a0230
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
12 deletions
+13
-12
circle/common/models.py
+4
-4
circle/dashboard/tests/test_mockedviews.py
+3
-2
circle/dashboard/validators.py
+1
-1
circle/dashboard/views/autocomplete.py
+1
-1
circle/dashboard/views/util.py
+4
-4
No files found.
circle/common/models.py
View file @
ae1c0a7d
...
@@ -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
):
...
...
circle/dashboard/tests/test_mockedviews.py
View file @
ae1c0a7d
...
@@ -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
))
circle/dashboard/validators.py
View file @
ae1c0a7d
...
@@ -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
:
...
...
circle/dashboard/views/autocomplete.py
View file @
ae1c0a7d
...
@@ -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
'<b>Akkount <span class="autocomplete-hl">Kro</span>kodil'
'<b>Akkount <span class="autocomplete-hl">Kro</span>kodil'
"""
"""
if
not
field
:
if
not
field
:
...
...
circle/dashboard/views/util.py
View file @
ae1c0a7d
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment