Exemplo n.º 1
0
    def test_not_modified(self):
        """ Update personal contact infos for unmodified BonitaUser """
        user = BonitaUser(username=u'myusername', password=u'mypassword')
        user._uuid = 'myuuid'

        # Mark user as unmodified
        user.clear_state()

        user._update_personal_contact_infos()

        assert user.is_modified is False
Exemplo n.º 2
0
    def test_modified(self):
        """ Update personal contact infos of a BonitaUser """
        user = BonitaUser(username=u'myusername', password=u'mypassword')
        user._uuid = 'myuuid'

        # Prepare response of MockedServer
        url = '/identityAPI/updateUserPersonalContactInfo'
        code = 200
        user_xml = build_bonita_user_xml(uuid='myuuid', password='******', username='******')
        BonitaServer.set_response_list([[url, code, user_xml]])

        # Modify some personal contact data
        user.personal_infos['building'] = u'building'
        user.personal_infos['website'] = u'website'
        user.personal_infos['state'] = u'state'
        user.personal_infos['city'] = u'city'
        user.personal_infos['country'] = u'country'
        user.personal_infos['faxNumber'] = u'faxNumber'
        user.personal_infos['phoneNumber'] = u'phoneNumber'
        user.personal_infos['email'] = u'email'
        user.personal_infos['address'] = u'address'
        user.personal_infos['zipCode'] = u'zipCode'
        user.personal_infos['mobileNumber'] = u'mobileNumber'
        user.personal_infos['room'] = u'room'

        user._update_personal_contact_infos()

        assert user.personal_infos['building'] == u'building'
        assert user.personal_infos['website'] == u'website'
        assert user.personal_infos['state'] == u'state'
        assert user.personal_infos['city'] == u'city'
        assert user.personal_infos['country'] == u'country'
        assert user.personal_infos['faxNumber'] == u'faxNumber'
        assert user.personal_infos['phoneNumber'] == u'phoneNumber'
        assert user.personal_infos['email'] == u'email'
        assert user.personal_infos['address'] == u'address'
        assert user.personal_infos['zipCode'] == u'zipCode'
        assert user.personal_infos['mobileNumber'] == u'mobileNumber'
        assert user.personal_infos['room'] == u'room'

        assert user.personal_infos.is_modified is False
Exemplo n.º 3
0
    def test_update_not_saved(self):
        """ Update personal contact infos for BonitaUser which is not already saved """
        user = BonitaUser(username=u'myusername', password=u'mypassword')

        user._update_personal_contact_infos()