def setUp(self): self.product = Product() self.product.name = 'test' self.product.short_description = 'test' self.product.long_description = 'test' self.product.unit_price = Decimal('1.0') self.product.save() self.view = ProductDetailView(kwargs={'pk': self.product.pk})
def create_fixtures(self): self.product = Product() self.product.name = 'test' self.product.short_description = 'test' self.product.long_description = 'test' self.product.unit_price = Decimal('1.0') self.product.save() self.view = ProductDetailView(kwargs={'pk': self.product.id})
def test_get_templates_return_expected_values(self): self.view = ProductDetailView() setattr(self.view, 'object', None) tmp = self.view.get_template_names() self.assertEqual(len(tmp), 1)