Skip to content
Snippets Groups Projects
Commit 04a380e9 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:ambulance: escape database name in do_tests.py

Name like mint-hr made it crash
parent f861a992
No related branches found
No related tags found
1 merge request!32🚑 escape database name in do_tests.py
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
flake8 and isort are not run by default when running docker_dev_start. flake8 and isort are not run by default when running docker_dev_start.
do_tests.py: Do not crash when super project has an hyphen in its name.
7.0.5 7.0.5
----- -----
......
...@@ -291,6 +291,6 @@ ...@@ -291,6 +291,6 @@
odoo_connection.autocommit = True odoo_connection.autocommit = True
with odoo_connection.cursor() as cursor: with odoo_connection.cursor() as cursor:
_logger.debug("Drop database %s", dbname) _logger.debug("Drop database %s", dbname)
cursor.execute("DROP DATABASE IF EXISTS %s" % dbname) cursor.execute('DROP DATABASE IF EXISTS "%s"' % dbname)
_logger.debug("Create database %s", dbname) _logger.debug("Create database %s", dbname)
cursor.execute( cursor.execute(
...@@ -295,6 +295,6 @@ ...@@ -295,6 +295,6 @@
_logger.debug("Create database %s", dbname) _logger.debug("Create database %s", dbname)
cursor.execute( cursor.execute(
"CREATE DATABASE %s OWNER %s" % (dbname, odoo_db_user) 'CREATE DATABASE "%s" OWNER %s' % (dbname, odoo_db_user)
) )
odoo_connection = connect( odoo_connection = connect(
user=pg_user, database=dbname, host=socket_path, port=5432 user=pg_user, database=dbname, host=socket_path, port=5432
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment