Ejemplo n.º 1
0
 def get(self):
     """
         Expects: nothing
         Modifies: nothing
         Returns: a query list of all the clients
     """
     return get_clients(request.args)
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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