Example #1
0
 def test_get_paginate_by_not_digit(self):
     """Test get_get_paginate_by when per_page is not a digit."""
     mixin = PaginateByMixin()
     mixin.request = self.request_factory.get('/?per_page=abc')
     self.assertEqual(mixin.get_paginate_by([]), None)
Example #2
0
 def test_get_paginate_by_not_in_querystring(self):
     """Test get_paginate_by when per_page is not provided."""
     mixin = PaginateByMixin()
     mixin.request = self.request_factory.get('/')
     self.assertEqual(mixin.get_paginate_by([]), None)
Example #3
0
 def test_get_paginate_by(self):
     """Test get_paginate_by."""
     mixin = PaginateByMixin()
     mixin.request = self.request_factory.get('/?per_page=100')
     self.assertEqual(mixin.get_paginate_by([]), 100)
 def test_get_paginate_by_not_digit(self):
     """Test get_get_paginate_by when per_page is not a digit."""
     mixin = PaginateByMixin()
     mixin.request = self.request_factory.get('/?per_page=abc')
     self.assertEqual(mixin.get_paginate_by([]), None)
 def test_get_paginate_by_not_in_querystring(self):
     """Test get_paginate_by when per_page is not provided."""
     mixin = PaginateByMixin()
     mixin.request = self.request_factory.get('/')
     self.assertEqual(mixin.get_paginate_by([]), None)
 def test_get_paginate_by(self):
     """Test get_paginate_by."""
     mixin = PaginateByMixin()
     mixin.request = self.request_factory.get('/?per_page=100')
     self.assertEqual(mixin.get_paginate_by([]), 100)