foreign key tests working on couchdb