def setUp(self): # make a product item = SimpleProduct() item.price = Decimal("199.99") item.title = 'Test Product' item.save() self.item = item # item2 = SimpleProduct() item2.price = Decimal("9.99") item2.title = 'Another Product' item2.save() self.item2 = item2 # get the basket r = self.client.get(reverse('ccbasket:basket')) self.basket = self.client.session['basket']
def setUp(self): # make the first product item = SimpleProduct() item.price = Decimal('199.99') item.title = 'Test Product' item.save() self.item = item # Make the second product item2 = SimpleProduct() item2.price = Decimal('9.99') item2.title = 'Another Product' item2.save() self.item2 = item2 # get the basket self.client.get('/') self.basket = self.client.session['basket']
def setUp(self): # make a product item = SimpleProduct() item.price = Decimal("199.99") item.title = 'Yamaha Manu Katché Signature Junior Hip Gig Kit in Black' item.description = "Manu Katché famous for playing drums for the likes of Peter Gabriel and Sting announced to Yamaha \"Why don't you make a real drum kit for kids?\" The design team for Yamaha got to work and here are the results. A fantastic Philippine mahogany shell drum kit that delivers a loud, warm and an open tone. The bass drum is made from 9 ply while the toms and snare drum are made up from 6-ply. Each ply is laminated together using the exclusive Air Seal System ensuring that every shell is a uniform thickness. Finished off with a tough and very durable lacquer. This is an ideal drum kit for a beginner to the professional. Due to its sizes this drum kit can fit into most rooms without taking up too much room making this a perfect compact portable/practice drum kit" item.save() self.item = item # get the basket r = self.client.get(reverse('ccbasket:basket')) self.basket = self.client.session['basket']
def setUp(self): # make a product item = SimpleProduct() item.price = Decimal("199.99") item.title = 'Test Product' item.save() self.item = item # item2 = SimpleProduct() item2.price = Decimal("9.99") item2.title = 'Another Product' item2.save() self.item2 = item2 # get the ctype self.ctype = ContentType.objects.get( app_label=self.item._meta.app_label, model=self.item._meta.object_name.lower()) # get the basket self.client.get(reverse('ccbasket:basket')) self.basket = self.client.session['basket']
def setUp(self): # set up the test list as empty dict global test_dict test_dict = {} # define a product to use item = SimpleProduct() item.price = Decimal("199.99") item.title = 'Test Product' item.save() self.item = item # get the basket r = self.client.get(reverse('ccbasket:basket')) self.basket = self.client.session['basket'] # delete cache self.basket._delete_cache()
def setUp(self): # create a product to use item = SimpleProduct() item.price = Decimal("199.99") item.title = 'Test Product' item.save() self.item = item # get the ctype self.ctype = ContentType.objects.get( app_label=self.item._meta.app_label, model=self.item._meta.object_name.lower()) # get a basket r = self.client.get(reverse('ccbasket:basket')) # request factory self.factory = RequestFactory()