Skip to content

Instantly share code, notes, and snippets.

@dreispt
Created May 14, 2014 13:39
Show Gist options
  • Save dreispt/ba5d0067368fdb095beb to your computer and use it in GitHub Desktop.
Save dreispt/ba5d0067368fdb095beb to your computer and use it in GitHub Desktop.
Create 1000 Project Issue for load testing
import xmlrpclib
host, port, db = "localhost", 8069, "demo"
user, pwd = "demo", "demo"
url = "http://%s:%d/xmlrpc/common" % (host, port)
sock = xmlrpclib.ServerProxy(url)
uid = sock.login(db, user, pwd)
url = "http://%s:%d/xmlrpc/object" % (host, port)
sock = xmlrpclib.ServerProxy(url)
for i in range(1000):
print i,
doc = {'name': 'Issue #%d' % i, 'project_id': 1}
doc_id = sock.execute(db, uid, pwd, 'project.issue', 'create', doc)
print "->", doc_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment