Beispiel #1
0
 def test_returns_default_if_limit_0(self):
     self.request.GET = {'limit': 0}
     limit = get_limit_parameter(self.request)
     self.assertEqual(limit, self.default_limit)
Beispiel #2
0
 def test_gets_limit_from_request(self):
     self.request.GET = {'limit': 5}
     limit = get_limit_parameter(self.request)
     self.assertEqual(limit, 5)
Beispiel #3
0
 def test_returns_default_if_no_limit_in_request(self):
     self.request.GET = {}
     limit = get_limit_parameter(self.request)
     self.assertEqual(limit, self.default_limit)
Beispiel #4
0
 def test_returns_default_if_limit_bigger_than_maximum(self):
     self.request.GET = {'limit': 1000}
     limit = get_limit_parameter(self.request)
     self.assertEqual(limit, self.default_limit)
Beispiel #5
0
 def test_returns_default_if_limit_0(self):
     self.request.GET = {'limit': 0}
     limit = get_limit_parameter(self.request)
     self.assertEqual(limit, self.default_limit)
Beispiel #6
0
 def test_returns_default_if_no_limit_in_request(self):
     self.request.GET = {}
     limit = get_limit_parameter(self.request)
     self.assertEqual(limit, self.default_limit)
Beispiel #7
0
 def test_gets_limit_from_request(self):
     self.request.GET = {'limit': 5}
     limit = get_limit_parameter(self.request)
     self.assertEqual(limit, 5)
Beispiel #8
0
 def test_returns_default_if_limit_bigger_than_maximum(self):
     self.request.GET = {'limit': 1000}
     limit = get_limit_parameter(self.request)
     self.assertEqual(limit, self.default_limit)