def create_discount(self,**kwargs):
test_group, created = PointGroup.objects.get_or_create(name=kwargs.get('<STR_LIT>','<STR_LIT>'))<EOL>pt_group, created = PricingTierGroup.objects.get_or_create(<EOL>group=test_group,<EOL>pricingTier=self.defaultPricing,<EOL>points=kwargs.get('<STR_LIT>', <NUM_LIT:5>),<EOL>)<EOL>test_combo = DiscountCombo(<EOL>name=kwargs.get('<STR_LIT:name>','<STR_LIT>'),<EOL>category=kwargs.get('<STR_LIT>',DiscountCategory.objects.get(id=<NUM_LIT:1>)),<EOL>discountType=kwargs.get('<STR_LIT>',DiscountCombo.DiscountType.flatPrice),<EOL>onlinePrice=kwargs.get('<STR_LIT>',self.defaultPricing.onlinePrice - <NUM_LIT:5>),<EOL>doorPrice=kwargs.get('<STR_LIT>',self.defaultPricing.doorPrice - <NUM_LIT:5>),<EOL>dollarDiscount=kwargs.get('<STR_LIT>',<NUM_LIT:10>),<EOL>percentDiscount=kwargs.get('<STR_LIT>',<NUM_LIT:50>),<EOL>percentUniversallyApplied=kwargs.get('<STR_LIT>',False),<EOL>active=kwargs.get('<STR_LIT>',True),<EOL>newCustomersOnly=kwargs.get('<STR_LIT>',False),<EOL>daysInAdvanceRequired=kwargs.get('<STR_LIT>',None),<EOL>expirationDate=kwargs.get('<STR_LIT>',None),<EOL>)<EOL>test_combo.save()<EOL>test_component = DiscountComboComponent.objects.create(<EOL>discountCombo=test_combo,<EOL>pointGroup=test_group,<EOL>quantity=kwargs.get('<STR_LIT>',<NUM_LIT:5>),<EOL>allWithinPointGroup=kwargs.get('<STR_LIT>',False),<EOL>)<EOL>return (test_combo, test_component)<EOL>
This method just creates the necessary objects to create a simple discount
with a single required component.