Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
57ca88e2
Commit
57ca88e2
authored
Oct 11, 2022
by
Kazuhiko Shiozaki
Committed by
Jérome Perrin
Mar 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py2/py3: DB.query() argument should be bytes.
parent
3fe90c8b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Type.py
...tTemplateItem/portal_components/test.erp5.testERP5Type.py
+2
-2
product/ZMySQLDA/tests/testDeferredConnection.py
product/ZMySQLDA/tests/testDeferredConnection.py
+5
-5
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Type.py
View file @
57ca88e2
...
...
@@ -465,12 +465,12 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
return
row
.
title
modified_title
=
getTitleFromCatalog
()
+
'_not_reindexed'
catalog_connection
=
self
.
getSQLConnection
()()
catalog_connection
.
query
(
catalog_connection
.
query
(
bytes
(
'UPDATE catalog SET title=%s WHERE uid=%i'
%
(
catalog_connection
.
string_literal
(
modified_title
),
person_object
.
getUid
(),
),
)
)
)
self
.
commit
()
# sanity check
self
.
assertEqual
(
getTitleFromCatalog
(),
modified_title
)
...
...
product/ZMySQLDA/tests/testDeferredConnection.py
View file @
57ca88e2
...
...
@@ -111,7 +111,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
Check that a basic query succeeds.
"""
connection
=
self
.
getDeferredConnection
()
connection
.
query
(
'REPLACE INTO `full_text` SET `uid`=0, `SearchableText`="dummy test"'
)
connection
.
query
(
b
'REPLACE INTO `full_text` SET `uid`=0, `SearchableText`="dummy test"'
)
try
:
self
.
commit
()
except
OperationalError
:
...
...
@@ -128,7 +128,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
"""
connection
=
self
.
getDeferredConnection
()
# Queue a query
connection
.
query
(
'REPLACE INTO `full_text` SET `uid`=0, `SearchableText`="dummy test"'
)
connection
.
query
(
b
'REPLACE INTO `full_text` SET `uid`=0, `SearchableText`="dummy test"'
)
# Replace dynamically the function used to send queries to mysql so it's
# dumber than the implemented one.
self
.
monkeypatchConnection
(
connection
)
...
...
@@ -153,7 +153,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
"""
connection
=
self
.
getDeferredConnection
()
# Queue a query
connection
.
query
(
'REPLACE INTO `full_text` SET `uid`=0, `SearchableText`="dummy test"'
)
connection
.
query
(
b
'REPLACE INTO `full_text` SET `uid`=0, `SearchableText`="dummy test"'
)
# Artificially cause a connection close.
self
.
monkeypatchConnection
(
connection
)
try
:
...
...
@@ -169,10 +169,10 @@ class TestDeferredConnection(ERP5TypeTestCase):
"""
connection
=
self
.
getDeferredConnection
()
# Queue a query
connection
.
query
(
'REPLACE INTO `full_text` SET `uid`=0, `SearchableText`="dummy test"'
)
connection
.
query
(
b
'REPLACE INTO `full_text` SET `uid`=0, `SearchableText`="dummy test"'
)
self
.
assertEqual
(
len
(
connection
.
_sql_string_list
),
1
)
self
.
commit
()
connection
.
query
(
'REPLACE INTO `full_text` SET `uid`=0, `SearchableText`="dummy test"'
)
connection
.
query
(
b
'REPLACE INTO `full_text` SET `uid`=0, `SearchableText`="dummy test"'
)
self
.
assertEqual
(
len
(
connection
.
_sql_string_list
),
1
)
if
__name__
==
'__main__'
:
...
...
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