Source code for odoo_xmlrpc_twisted.test.test_update_user_profile_values
"""test program for module :func:`odoo_xmlrpc_twisted.functions.update_user_profile_values`based on the "unittest" functionality"""importunittestimportosimportsysimportconfigparser# Import base test case for shared Odoo connectionfromodoo_xmlrpc_twisted.test.base_test_caseimportOdooTestCase# as this program is in the folder "test",# import the module to test from the parent directorycurrent=os.path.dirname(os.path.realpath(__file__))parent_directory=os.path.dirname(current)sys.path.append(parent_directory)sys.path.append(os.path.join(parent_directory,'functions'))fromupdate_user_profile_valuesimportupdate_user_profile_values# ------- get parameter from the settings file "parameter_test.ini" # Name and full path of the "ini" filefilename="parameter_test.ini"# Get the parent directory (repo root) and navigate to config foldercurrent_dir=os.path.dirname(os.path.abspath(__file__))parent_dir=os.path.dirname(current_dir)config_dir=os.path.join(parent_dir,'config')fullpath=os.path.join(config_dir,filename)config=configparser.ConfigParser()config.read(fullpath)# get the dedicated user_id of the customercustom_user_id=int(config.get('get_settings_customer','user_id'))# get the dedicated login of the customercustom_login=config.get('get_settings_customer','login')# get the dedicated email of the customercustom_email=config.get('get_settings_customer','email')# get the dedicated name of the customercustom_name=config.get('get_settings_customer','name')# get the dedicated title of the customercustom_title=config.get('get_settings_customer','title')# get the dedicated language of the customercustom_language=config.get('get_settings_customer','language')# get the dedicated language of the customercustom_language=config.get('get_settings_customer','language')# get the dedicated phone number of the customercustom_phone_number=config.get('get_settings_customer','phone')# get the dedicated mobile number of the customercustom_mobile_number=config.get('get_settings_customer','mobile')
[docs]classtest_update_user_profile_values(OdooTestCase):""" Class for the test cases of the module "update_user_profile_values" """
[docs]deftest_cases(self):""" test cases of the module "update_user_profile_values" """self.assertEqual(update_user_profile_values(custom_user_id,custom_login,custom_email,custom_name,custom_title,custom_language,custom_phone_number,custom_mobile_number),True)