couchdb test code