title: Django Queryset mock objects and count
body: <p>I am looking for a way to mock both the Django queryset result and the count result in the same test.
  Please find below a code snippet to give an overview of what I try to do. This is not the real code, just a simplified version that does nothing interesting.</p>
  <pre><code># METHOD 
  def method_to_mock(car_ids):
      cars = Car.objects.filter(id__in=car_ids).order_by(&quot;creation_date&quot;)
      if cars.count() != len(car_ids):
          missing_cars = set(car_ids) - set(cars.values_list(&quot;id&quot;, flat=True))
          logger.error(f&quot;Failed to retrieve cars {missing_cars}.&quot;)
  
      for car in cars:
          print(car.brand)
  
  # TESTING
  mock_filter = mocker.patch(&quot;Car.objects&quot;)
  mock_filter.filter.return_value.order_by.return_value = [mocker.Mock(), mocker.Mock()]
  mock_filter.filter.return_value.order_by.return_value.count.return_value = 2
  method_to_mock([0, 1, 2])
  </code></pre>
  <p>This does not work as the list of mocks do not have a count method. I don't want to return a Mock instead of the list of Mock as I still want to be able to loop through the mocks.</p>
  <p>Could you please help on that ?</p>
  <p>Thanks !</p>