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
143
Merge Requests
143
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
3258ea9e
Commit
3258ea9e
authored
Oct 11, 2022
by
Kazuhiko Shiozaki
Committed by
Arnaud Fontaine
Mar 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py2/py3: DB.query() argument should be bytes.
parent
a45d96a9
Changes
2
Hide 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 @
3258ea9e
...
@@ -465,12 +465,12 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
...
@@ -465,12 +465,12 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
return
row
.
title
return
row
.
title
modified_title
=
getTitleFromCatalog
()
+
'_not_reindexed'
modified_title
=
getTitleFromCatalog
()
+
'_not_reindexed'
catalog_connection
=
self
.
getSQLConnection
()()
catalog_connection
=
self
.
getSQLConnection
()()
catalog_connection
.
query
(
catalog_connection
.
query
(
bytes
(
'UPDATE catalog SET title=%s WHERE uid=%i'
%
(
'UPDATE catalog SET title=%s WHERE uid=%i'
%
(
catalog_connection
.
string_literal
(
modified_title
),
catalog_connection
.
string_literal
(
modified_title
),
person_object
.
getUid
(),
person_object
.
getUid
(),
),
),
)
)
)
self
.
commit
()
self
.
commit
()
# sanity check
# sanity check
self
.
assertEqual
(
getTitleFromCatalog
(),
modified_title
)
self
.
assertEqual
(
getTitleFromCatalog
(),
modified_title
)
...
...
product/ZMySQLDA/tests/testDeferredConnection.py
View file @
3258ea9e
...
@@ -111,7 +111,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
...
@@ -111,7 +111,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
Check that a basic query succeeds.
Check that a basic query succeeds.
"""
"""
connection
=
self
.
getDeferredConnection
()
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
:
try
:
self
.
commit
()
self
.
commit
()
except
OperationalError
:
except
OperationalError
:
...
@@ -128,7 +128,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
...
@@ -128,7 +128,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
"""
"""
connection
=
self
.
getDeferredConnection
()
connection
=
self
.
getDeferredConnection
()
# Queue a query
# 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
# Replace dynamically the function used to send queries to mysql so it's
# dumber than the implemented one.
# dumber than the implemented one.
self
.
monkeypatchConnection
(
connection
)
self
.
monkeypatchConnection
(
connection
)
...
@@ -153,7 +153,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
...
@@ -153,7 +153,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
"""
"""
connection
=
self
.
getDeferredConnection
()
connection
=
self
.
getDeferredConnection
()
# Queue a query
# 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.
# Artificially cause a connection close.
self
.
monkeypatchConnection
(
connection
)
self
.
monkeypatchConnection
(
connection
)
try
:
try
:
...
@@ -169,10 +169,10 @@ class TestDeferredConnection(ERP5TypeTestCase):
...
@@ -169,10 +169,10 @@ class TestDeferredConnection(ERP5TypeTestCase):
"""
"""
connection
=
self
.
getDeferredConnection
()
connection
=
self
.
getDeferredConnection
()
# Queue a query
# 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
.
assertEqual
(
len
(
connection
.
_sql_string_list
),
1
)
self
.
commit
()
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
)
self
.
assertEqual
(
len
(
connection
.
_sql_string_list
),
1
)
if
__name__
==
'__main__'
:
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