  from rest_framework.settings import api_settings
  import warnings
  
  
  def strict_positive_int(integer_string):
      """
      Cast a string to a strictly positive integer.
      """
      ret = int(integer_string)
      if ret <= 0:
 
</s> remove         if self.max_paginate_by:
            return min(self.max_paginate_by, self.paginate_by)
        else:
            return self.paginate_by
 </s> add         return self.paginate_by </s> remove         self.assertEqual(response.data['results'], self.data[:3])
 </s> add         self.assertEqual(response.data['results'], self.data[:5]) </s> remove     paginate_by = 5
    max_paginate_by = 3
 </s> add     paginate_by = 3
    max_paginate_by = 5 </s> remove             query_params = self.request.QUERY_PARAMS
 </s> add 
def strict_positive_int(integer_string, cutoff=None):
  from rest_framework.settings import api_settings
  import warnings
  
  
def strict_positive_int(integer_string, cutoff=None):
      """
      Cast a string to a strictly positive integer.
      """
      ret = int(integer_string)
      if ret <= 0:
keep keep keep keep replace keep keep keep keep keep
 Tweak MAX_PAGINATE_BY behavior in edge case.

Always respect `paginate_by` settings if client does not specify page
size.  (Even if the developer has misconfigured, so that `paginate_by >
max`.) 
rest_framework/generics.py