Exemplo n.º 1
0
    def test_is_voicemail_linked_with_user(self):
        voicemail = self.create_voicemail(number='42', context='default')
        self.create_user_with_voicemail(voicemail,
                                        firstname='Joe')

        result = voicemail_dao.is_voicemail_linked(voicemail)

        self.assertTrue(result)
Exemplo n.º 2
0
def _check_if_voicemail_linked_on_edit(voicemail):
    if voicemail_dao.is_voicemail_linked(voicemail):
        raise ElementEditionError("voicemail", "Cannot edit a voicemail associated to a user")
Exemplo n.º 3
0
def _check_if_voicemail_linked_on_delete(voicemail):
    if voicemail_dao.is_voicemail_linked(voicemail):
        raise ElementDeletionError("voicemail", "Cannot delete a voicemail associated to a user")
Exemplo n.º 4
0
    def test_is_voicemail_linked_no_links(self):
        voicemail = self.create_voicemail(number='42', context='default')

        result = voicemail_dao.is_voicemail_linked(voicemail)

        self.assertFalse(result)
Exemplo n.º 5
0
def _check_if_voicemail_associated(voicemail):
    if voicemail_dao.is_voicemail_linked(voicemail):
        raise errors.resource_associated('Voicemail', 'User')
Exemplo n.º 6
0
def _check_if_voicemail_linked_on_edit(voicemail):
    if voicemail_dao.is_voicemail_linked(voicemail):
        raise ElementEditionError('voicemail', 'Cannot edit a voicemail associated to a user')
Exemplo n.º 7
0
def _check_if_voicemail_linked_on_delete(voicemail):
    if voicemail_dao.is_voicemail_linked(voicemail):
        raise ElementDeletionError('voicemail', 'Cannot delete a voicemail associated to a user')