[FIX] use the new xmlrpc-1 URIs in the tests.
bzr revid: vmt@openerp.com-20111003093355-2agzw7euaphdq7yr
This commit is contained in:
parent
03e842f672
commit
608274e292
|
@ -23,6 +23,7 @@ object_proxy_60 = None
|
||||||
common_proxy_61 = None
|
common_proxy_61 = None
|
||||||
db_proxy_61 = None
|
db_proxy_61 = None
|
||||||
model_proxy_61 = None
|
model_proxy_61 = None
|
||||||
|
model_uri_61 = None
|
||||||
|
|
||||||
def setUpModule():
|
def setUpModule():
|
||||||
"""
|
"""
|
||||||
|
@ -46,13 +47,13 @@ def setUpModule():
|
||||||
global common_proxy_61
|
global common_proxy_61
|
||||||
global db_proxy_61
|
global db_proxy_61
|
||||||
global model_proxy_61
|
global model_proxy_61
|
||||||
|
global model_uri_61
|
||||||
|
|
||||||
# Use the new (6.1) API.
|
# Use the new (6.1) API.
|
||||||
url = 'http://%s:%d/openerp/6.1/xmlrpc/' % (HOST, PORT)
|
model_uri_61 = 'http://%s:%d/openerp/xmlrpc/1/' % (HOST, PORT)
|
||||||
common_proxy_61 = xmlrpclib.ServerProxy(url + 'common')
|
common_proxy_61 = xmlrpclib.ServerProxy(model_uri_61 + 'common')
|
||||||
db_proxy_61 = xmlrpclib.ServerProxy(url + 'db')
|
db_proxy_61 = xmlrpclib.ServerProxy(model_uri_61 + 'db')
|
||||||
model_proxy_61 = xmlrpclib.ServerProxy(url + 'model/' + DB)
|
model_proxy_61 = xmlrpclib.ServerProxy(model_uri_61 + 'model/' + DB)
|
||||||
|
|
||||||
|
|
||||||
# Ugly way to ensure the server is listening.
|
# Ugly way to ensure the server is listening.
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
|
@ -54,9 +54,11 @@ class test_xmlrpc(unittest2.TestCase):
|
||||||
|
|
||||||
def test_xmlrpc_61_ir_model_search(self):
|
def test_xmlrpc_61_ir_model_search(self):
|
||||||
""" Try a search on the object service. """
|
""" Try a search on the object service. """
|
||||||
ids = common.model_proxy_61.execute(ADMIN_USER_ID, ADMIN_PASSWORD, 'ir.model', 'search', [])
|
|
||||||
|
proxy = xmlrpclib.ServerProxy(common.model_uri_61 + 'model/' + DB + '/ir.model')
|
||||||
|
ids = proxy.execute(ADMIN_USER_ID, ADMIN_PASSWORD, 'search', [])
|
||||||
assert ids
|
assert ids
|
||||||
ids = common.model_proxy_61.execute(ADMIN_USER_ID, ADMIN_PASSWORD, 'ir.model', 'search', [], {})
|
ids = proxy.execute(ADMIN_USER_ID, ADMIN_PASSWORD, 'search', [], {})
|
||||||
assert ids
|
assert ids
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue