Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubicweb
Commits
afc678253bc2
Commit
b4b46440
authored
Jan 24, 2018
by
Denis Laxalde
Browse files
[py3] Drop a couple of unicode() in devtools.testlib
parent
676c166bbd74
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb/devtools/testlib.py
View file @
afc67825
...
...
@@ -29,7 +29,7 @@ from inspect import isgeneratorfunction
from
itertools
import
chain
from
warnings
import
warn
from
six
import
text_type
,
string_types
,
reraise
from
six
import
binary_type
,
text_type
,
string_types
,
reraise
from
six.moves
import
range
from
six.moves.urllib.parse
import
urlparse
,
parse_qs
,
unquote
as
urlunquote
...
...
@@ -758,7 +758,7 @@ class CubicWebTC(BaseTestCase):
req.form will be setup using the url's query string
"""
req
=
self
.
request
(
url
=
url
)
if
isinstance
(
url
,
unicod
e
):
if
isinstance
(
url
,
text_typ
e
):
url
=
url
.
encode
(
req
.
encoding
)
# req.setup_params() expects encoded strings
querystring
=
urlparse
(
url
)[
-
2
]
params
=
parse_qs
(
querystring
)
...
...
@@ -772,7 +772,7 @@ class CubicWebTC(BaseTestCase):
req.form will be setup using the url's query string
"""
with
self
.
admin_access
.
web_request
(
url
=
url
)
as
req
:
if
isinstance
(
url
,
unicod
e
):
if
isinstance
(
url
,
text_typ
e
):
url
=
url
.
encode
(
req
.
encoding
)
# req.setup_params() expects encoded strings
querystring
=
urlparse
(
url
)[
-
2
]
params
=
parse_qs
(
querystring
)
...
...
@@ -1024,8 +1024,8 @@ class CubicWebTC(BaseTestCase):
position
=
getattr
(
exc
,
"position"
,
(
0
,))[
0
]
if
position
:
# define filter
if
isinstance
(
content
,
str
):
content
=
unicod
e
(
content
,
sys
.
getdefaultencoding
(),
'replace'
)
if
isinstance
(
content
,
binary_type
):
content
=
text_typ
e
(
content
,
sys
.
getdefaultencoding
(),
'replace'
)
content
=
validator
.
preprocess_data
(
content
)
content
=
content
.
splitlines
()
width
=
int
(
log
(
len
(
content
),
10
))
+
1
...
...
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