# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1520933760 -3600
#      Tue Mar 13 10:36:00 2018 +0100
# Node ID 2fd873eae8d1cab0078bf7a3599a210e6d803509
# Parent  e7f786bd134a4646bd5fc850092488b45afd7054
do_tests: default to odoo for user if there is no sample configuration file for odoo

diff --git a/do_tests b/do_tests
--- a/do_tests
+++ b/do_tests
@@ -19,7 +19,12 @@
 project_home=$(cd $here && cd .. && echo $PWD)
 dbname=$(basename $project_home)_test
 # this is the same value as conf/dev/odoo.conf
-dbowner=$(python -B -c "import ConfigParser ; c = ConfigParser.ConfigParser() ; c.read('${project_home}/conf/dev/odoo.conf') ; print c.get('options', 'db_user')")
+if [[ -e "${project_home}/conf/dev/odoo.conf" ]];
+then
+    dbowner=$(python -B -c "import ConfigParser ; c = ConfigParser.ConfigParser() ; c.read('${project_home}/conf/dev/odoo.conf') ; print c.get('options', 'db_user')")
+else
+    dbowner=odoo
+fi
 modules_to_install=$(python -B -c "import ConfigParser ; c = ConfigParser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print ','.join(c.get('odoo_scripts', 'module_list', '').split())")
 
 # color stuff