Beispiel #1
0
 def create_test_item(name, event, **kwargs):
     item = StoreItem()
     item.name = name
     item.event = event
     item.description = kwargs.get('description', fake.sentences(3))
     item.price = kwargs.get('price', 20)
     item.max = kwargs.get('max', 50)
     item.available = kwargs.get('available', True)
     item.max_per_order = kwargs.get('max_per_order', 5)
     item.sort_index = kwargs.get('sort_index', 0)
     item.discount_amount = kwargs.get('discount_amount', -1)
     item.discount_percentage = kwargs.get('discount_percentage', 0)
     item.is_ticket = kwargs.get('is_ticket', False)
     item.save()
     return item
Beispiel #2
0
 def create_test_item(name, event, **kwargs):
     item = StoreItem()
     item.name = name
     item.event = event
     item.description = kwargs.get('description', fake.sentences(3))
     item.price = kwargs.get('price', 20)
     item.max = kwargs.get('max', 50)
     item.available = kwargs.get('available', True)
     item.max_per_order = kwargs.get('max_per_order', 5)
     item.sort_index = kwargs.get('sort_index', 0)
     item.discount_amount = kwargs.get('discount_amount', -1)
     item.discount_percentage = kwargs.get('discount_percentage', 0)
     item.is_ticket = kwargs.get('is_ticket', False)
     item.save()
     return item