def get(self): """ Expects: nothing Modifies: nothing Returns: a query list of all the clients """ return get_clients(request.args)
def test_get_clients_ordered_by_orders(self): response = list(get_clients({'sort-input': 'num_orders'})) for client_i in range(1, len(response)): assert response[ client_i - 1].number_of_orders <= response[client_i].number_of_orders
def test_get_clients_ordered_by_first_name_desc(self): response = list(get_clients({ 'sort-input': 'first_name', 'desc': True })) for client_i in range(1, len(response)): assert response[client_i - 1].first_name >= response[client_i].first_name
def test_get_clients_ordered_by_last_name(self): response = list(get_clients({'sort-input': 'last_name'})) for client_i in range(1, len(response)): assert response[client_i - 1].last_name <= response[client_i].last_name