def test_base_attributes_modified(self): """ Update BonitaUser base attributes """ user = BonitaUser(username=u'myusername', password=u'mypassword') user._uuid = 'myuuid' user.clear() # Prepare response of MockedServer url = '/identityAPI/updateUserByUUID' code = 200 user_xml = build_bonita_user_xml(uuid='myuuid', password='******', username='******') BonitaServer.set_response_list([[url, code, user_xml]]) # Modify some base attributes user.last_name = u'last_name' user.title = u'Doctor' user.username = u'other_username' user.first_name = u'first_name' user.job_title = u'job_title' user._update() assert user.is_modified is False assert user.last_name == u'last_name' assert user.title == u'Doctor' assert user.username == u'other_username' assert user.first_name == u'first_name' assert user.job_title == u'job_title'
def test_not_modified(self): """ Update an unmodified BonitaUser """ user = BonitaUser(username=u'myusername', password=u'mypassword') user._uuid = 'myuuid' # Mark user as unmodified user.clear() user._update() assert user.is_modified is False
def test_password_modified(self): """ Update password contact infos of BonitaUser """ user = BonitaUser(username=u'myusername', password=u'mypassword') user._uuid = 'myuuid' user.clear() # Prepare response of MockedServer url = '/identityAPI/updateUserPassword' code = 200 user_xml = build_bonita_user_xml(uuid='myuuid', password='******', username='******') BonitaServer.set_response_list([[url, code, user_xml]]) # Modify password user.password = u'some pass' user._update() assert user.is_modified is False assert user.password == u'some pass'
def test_professional_contact_infos_modified(self): """ Update profressional contact infos of BonitaUser """ user = BonitaUser(username=u'myusername', password=u'mypassword') user._uuid = 'myuuid' user.clear() # Prepare response of MockedServer url = '/identityAPI/updateUserProfessionalContactInfo' code = 200 user_xml = build_bonita_user_xml(uuid='myuuid', password='******', username='******') BonitaServer.set_response_list([[url, code, user_xml]]) # Modify some professional contact data user.professional_infos['building'] = u'building' user.professional_infos['website'] = u'website' user.professional_infos['state'] = u'state' user.professional_infos['city'] = u'city' user.professional_infos['country'] = u'country' user.professional_infos['faxNumber'] = u'faxNumber' user.professional_infos['phoneNumber'] = u'phoneNumber' user.professional_infos['email'] = u'email' user.professional_infos['address'] = u'address' user.professional_infos['zipCode'] = u'zipCode' user.professional_infos['mobileNumber'] = u'mobileNumber' user.professional_infos['room'] = u'room' user._update() assert user.is_modified is False assert user.professional_infos['building'] == u'building' assert user.professional_infos['website'] == u'website' assert user.professional_infos['state'] == u'state' assert user.professional_infos['city'] == u'city' assert user.professional_infos['country'] == u'country' assert user.professional_infos['faxNumber'] == u'faxNumber' assert user.professional_infos['phoneNumber'] == u'phoneNumber' assert user.professional_infos['email'] == u'email' assert user.professional_infos['address'] == u'address' assert user.professional_infos['zipCode'] == u'zipCode' assert user.professional_infos['mobileNumber'] == u'mobileNumber' assert user.professional_infos['room'] == u'room'