Exemple #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)
Exemple #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")
Exemple #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")
Exemple #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)
Exemple #5
0
def _check_if_voicemail_associated(voicemail):
    if voicemail_dao.is_voicemail_linked(voicemail):
        raise errors.resource_associated('Voicemail', 'User')
Exemple #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')
Exemple #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')