def setUp(self): super(TableResourceTest, self).setUp() #Create the user self.username = '******' self.password = '******' self.user = User.objects.create_user(self.username, '*****@*****.**', self.password) #Create a model to be used for testing model_data = base_model.copy() del model_data['images'] self.model = Model(**model_data) self.model.save() #Create configuration for testing self.configuration = Configuration(configuration='Coffee Table') self.configuration.save() #Strip pillows and make pillows separately table_data = base_product.copy() del table_data['corner_pillow'] del table_data['accent_pillow'] del table_data['back_pillow'] del table_data['lumbar_pillow'] self.product = Table(**table_data) self.product.description = 'AC-1 Coffee Table' self.product.type = 'table' self.product.model = self.model self.product.configuration = self.configuration self.product.save()
def setUp(self): super(ModelResourceTest, self).setUp() #Create the user self.username = '******' self.password = '******' self.user = User.objects.create_user(self.username, '*****@*****.**', self.password) #Create a model to be used for testing model_data = base_model.copy() del model_data['images'] self.model = Model(**model_data) self.model.save()