Source code for odoo_xmlrpc_twisted.test.test_get_user_address_values
"""test program for module :func:`odoo_xmlrpc_twisted.functions.get_user_address_values`based on the "unittest" functionality"""importunittestimportosimportsysimportconfigparser# Import base test case for shared Odoo connectionfromodoo_xmlrpc_twisted.test.base_test_caseimportReadOnlyOdooTestCase# 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'))fromget_user_address_valuesimportget_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 partner_id of the customercustom_partner_id=int(config.get('get_settings_customer','partner_id'))# get the dedicated country of the customercustom_country_code=int(config.get('get_settings_customer','country'))# get the dedicated language of the customercustom_user_language_code=config.get('get_settings_customer','language')
[docs]classtest_get_user_address_values(ReadOnlyOdooTestCase):""" Class for the test cases of the module "get_user_address_values" """
[docs]deftest_cases(self):""" test cases of the module "get_user_address_values" """self.assertTrue(get_user_address_values(custom_partner_id,custom_country_code,custom_user_language_code))