Esempio n. 1
0
 def test_child_category_view(self):
     """
     Test child category page opens with Http 200 OK status and contain proper insides
     """
     product = ProductFactory(category=self.child_category_enabled)
     page = self.app.get(reverse('doppler_shift_catalog_category', kwargs={'category_id': self.child_category_enabled.pk}))
     self.assertEqual(page.status, '200 OK')
     self.assertIn(self.child_category_enabled.name, page)
     self.assertIn(self.child_category_enabled.description, page)
     #TODO: add main image presence test here
     self.assertIn(product.name, page)
     self.assertIn(product.get_absolute_url(), page)
Esempio n. 2
0
 def test_product_breadcrumbs(self):
     """
     Test product breadcrumbs
     """
     product = ProductFactory(category=self.child_category_enabled)
     page = self.app.get(reverse('doppler_shift_catalog_product', kwargs={'product_id': product.pk}))
     category = product.category
     for ancestor in category.get_ancestors(include_self=True):
         self.assertIn(ancestor.name, page)
         self.assertIn(ancestor.get_absolute_url(), page)
     self.assertIn(product.name, page)
     self.assertIn(product.get_absolute_url(), page)