Skip to content

Commit 8735291

Browse files
committed
testando as novas CMV
1 parent ada99fe commit 8735291

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

catalog/tests/test_views.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ def test_view_ok(self):
2222

2323
def test_context(self):
2424
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)
25+
self.assertTrue('products' in response.context)
26+
product_list = response.context['products']
27+
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

Comments
 (0)