Source code for odoo_xmlrpc_twisted.test.test_update_user_address_values
"""test program for module :func:`odoo_xmlrpc_twisted.functions.update_user_address_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_address_valuesimportupdate_user_address_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_partner_id=int(config.get('get_settings_customer','partner_id'))# get the dedicated address values of the customercustom_type=config.get('get_settings_customer','address_type')custom_street=config.get('get_settings_customer','address_street')custom_street_2=config.get('get_settings_customer','address_street_2')custom_zip=config.get('get_settings_customer','address_zip')custom_city=config.get('get_settings_customer','address_city')custom_state=config.get('get_settings_customer','address_state')custom_country=config.get('get_settings_customer','address_country')
[docs]classtest_update_user_address_values(OdooTestCase):""" Class for the test cases of the module "update_user_address_values" """
[docs]deftest_cases(self):""" test cases of the module "update_user_address_values" """self.assertEqual(update_user_address_values(custom_partner_id,custom_type,custom_street,custom_street_2,custom_zip,custom_city,custom_state,custom_country),True)