예제 #1
0
 def get(self):
     """
         Expects: nothing
         Modifies: nothing
         Returns: a query list of all the clients
     """
     return get_clients(request.args)
예제 #2
0
    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
예제 #3
0
    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
예제 #4
0
    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