Exemple #1
0
    def create_fixtures(self):
        self.cat = Category()
        self.cat.name = 'Test Category'
        self.cat.save()

        self.product = Product()
        self.product.category = self.cat
        self.product.name = 'test'
        self.product.short_description = 'test'
        self.product.long_description = 'test'
        self.product.unit_price = Decimal('1.0')
        self.product.save()
Exemple #2
0
 def setUp(self):
     self.category = Category()
     self.category.name = "test_category"
     self.category.save()
     
     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.product.categories.add(self.category)