diff --git a/odoo/service/server.py b/odoo/service/server.py index 5612af5bf52..961199b7c62 100644 --- a/odoo/service/server.py +++ b/odoo/service/server.py @@ -1220,7 +1220,7 @@ def load_test_file_py(registry, test_file): threading.currentThread().testing = True try: test_path, _ = os.path.splitext(os.path.abspath(test_file)) - for mod in [m for m in get_modules() if '/%s/' % m in test_file]: + for mod in [m for m in get_modules() if '%s%s%s' % (os.path.sep, m, os.path.sep) in test_file]: for mod_mod in loader.get_test_modules(mod): mod_path, _ = os.path.splitext(getattr(mod_mod, '__file__', '')) if test_path == config._normalize(mod_path): diff --git a/odoo/tools/config.py b/odoo/tools/config.py index e2f4ebd195e..7c320372158 100644 --- a/odoo/tools/config.py +++ b/odoo/tools/config.py @@ -10,7 +10,7 @@ import sys import tempfile import warnings import odoo -from os.path import expandvars, expanduser, abspath, realpath +from os.path import expandvars, expanduser, abspath, realpath, normcase from .. import release, conf, loglevels from . import appdirs @@ -737,7 +737,7 @@ class configmanager(object): def _normalize(self, path): if not path: return '' - return realpath(abspath(expanduser(expandvars(path.strip())))) + return normcase(realpath(abspath(expanduser(expandvars(path.strip()))))) config = configmanager()