Esempio n. 1
0
def _delete_user_with_firstname_lastname(channel, firstname, lastname):
    from xivo_dao.data_handler.user import services as user_services

    user = user_services.find_by_firstname_lastname(firstname, lastname)

    if user:
        user_services.delete(user)
Esempio n. 2
0
def _delete_user_with_firstname_lastname(channel, firstname, lastname):
    from xivo_dao.data_handler.user import services as user_services

    user = user_services.find_by_firstname_lastname(firstname, lastname)

    if user:
        user_services.delete(user)
Esempio n. 3
0
    def test_find_user(self, user_dao_find_user):
        user = Mock(User)
        firstname = 'Lord'
        lastname = 'Sanderson'

        user_dao_find_user.return_value = user

        result = user_services.find_by_firstname_lastname(firstname, lastname)

        self.assertEquals(result, user)
        user_dao_find_user.assert_called_once_with(firstname, lastname)
Esempio n. 4
0
    def test_find_user(self, user_dao_find_user):
        user = Mock(User)
        firstname = 'Lord'
        lastname = 'Sanderson'

        user_dao_find_user.return_value = user

        result = user_services.find_by_firstname_lastname(firstname, lastname)

        self.assertEquals(result, user)
        user_dao_find_user.assert_called_once_with(firstname, lastname)
Esempio n. 5
0
def is_user_with_name_exists(firstname, lastname):
    user = user_services.find_by_firstname_lastname(firstname, lastname)
    if user is None:
        return False
    return True
Esempio n. 6
0
def find_by_firstname_lastname(firstname, lastname):
    return user_services.find_by_firstname_lastname(firstname, lastname)
Esempio n. 7
0
def is_user_with_name_exists(firstname, lastname):
    user = user_services.find_by_firstname_lastname(firstname, lastname)
    if user is None:
        return False
    return True
Esempio n. 8
0
def find_by_firstname_lastname(firstname, lastname):
    return user_services.find_by_firstname_lastname(firstname, lastname)