def booking(): today = date.today() tomorrow = today + timedelta(days=1) return ( BookingFactory(contact_email="*****@*****.**", departure_date=today), BookingFactory(contact_email="*****@*****.**", departure_date=tomorrow), )
def bookings(koie): return ( BookingFactory(), BookingFactory( koie=koie, arrival_date=now() + timedelta(days=1), departure_date=now() + timedelta(days=4), paid=False, created=now(), ), BookingFactory( koie=koie, arrival_date=now() + timedelta(days=3), departure_date=now() + timedelta(days=4), paid=True, ), )
def stripe_transaction(request): """ A StripeTransaction needs to be connected to a payment-object to be able to communicate with Stripe. The payment key is stored on the seller-object, and is accessed through the payment-object. As a payment-object automatically creates it´s own StripeTransaction, the only way to create a StripeTransaction with a connected payment-object is to create the payment-object and then extract the StripeTransaction-object. StripeTransaction should be agnostic to the actual implementation of the object, as long as it is a valid payment-object. To test multiple payment-object one can add additional params in the fixture decorator and expand the if-statement below with a new factory. """ if request.param == "booking_payment": payment_object = BookingFactory().booking_payment else: raise ValueError(f"{request.param} is not a valid payment object") return payment_object.transaction
def booking_batch(koie): return BookingFactory.create_batch(3, koie=koie)
def booking(koie): return BookingFactory(koie=koie)
def payment(): return BookingFactory().booking_payment
def booking(): return BookingFactory()
def booking(): return BookingFactory.build()