def booking():
    today = date.today()
    tomorrow = today + timedelta(days=1)
    return (
        BookingFactory(contact_email="*****@*****.**", departure_date=today),
        BookingFactory(contact_email="*****@*****.**", departure_date=tomorrow),
    )
示例#2
0
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,
        ),
    )
示例#3
0
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
示例#4
0
def booking_batch(koie):
    return BookingFactory.create_batch(3, koie=koie)
示例#5
0
def booking(koie):
    return BookingFactory(koie=koie)
def payment():
    return BookingFactory().booking_payment
示例#7
0
def booking():
    return BookingFactory()
示例#8
0
def booking():
    return BookingFactory.build()