def test_find_by_voicemail_id_when_voicemail_associated_to_user(self): user_row, voicemail_row = self.create_user_and_voicemail(firstname='Dolly', exten='1000', context='default') result = user_voicemail_dao.find_by_voicemail_id(voicemail_row.uniqueid) assert_that(result, instance_of(UserVoicemail)) assert_that(result, has_property('user_id', user_row.id), has_property('voicemail_id', voicemail_row.uniqueid))
def find_by_voicemail_id(voicemail_id): return dao.find_by_voicemail_id(voicemail_id)
def test_find_by_voicemail_id_voicemail_without_user(self): voicemail_row = self.add_voicemail(mailbox='1000', context='default') result = user_voicemail_dao.find_by_voicemail_id(voicemail_row.uniqueid) assert_that(result, none())
def test_find_by_voicemail_id_no_voicemail(self): result = user_voicemail_dao.find_by_voicemail_id(1) assert_that(result, none())