We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ada99fe commit 8735291Copy full SHA for 8735291
catalog/tests/test_views.py
@@ -22,6 +22,12 @@ def test_view_ok(self):
22
23
def test_context(self):
24
response = self.client.get(self.url)
25
- self.assertTrue('product_list' in response.context)
26
- product_list = response.context['product_list']
27
- self.assertEquals(product_list.count(), 10)
+ self.assertTrue('products' in response.context)
+ product_list = response.context['products']
+ self.assertEquals(product_list.count(), 3)
28
+ paginator = response.context['paginator']
29
+ self.assertEquals(paginator.num_pages, 4)
30
+
31
+ def test_page_not_found(self):
32
+ response = self.client.get('{}?page=5'.format(self.url))
33
+ self.assertEquals(response.status_code, 404)
0 commit comments