def test_offer_is_active_with_expired_match(factories): offer = factories.TicketOfferFactory() factories.ExpiredTicketMatchFactory( ticket_offer=offer, ) assert_is_active(offer)
def test_not_reserved_if_offer_terminated(factories): offer = factories.TicketOfferFactory() request = factories.TicketRequestFactory(is_cancelled=True) factories.TicketMatchFactory( ticket_request=request, ticket_offer=offer, ) assert_is_active(offer)
def test_offer_is_active_with_no_match(factories): offer = factories.TicketOfferFactory() assert_is_active(offer)
def test_offer_is_active_with_cancelled_match(factories): offer = factories.TicketOfferFactory() factories.TicketMatchFactory(ticket_offer=offer, ticket_request__is_terminated=True) assert_is_active(offer)
def test_request_is_active_with_no_match(factories): request = factories.TicketRequestFactory() assert_is_active(request)
def test_request_is_active_with_cancelled_match(factories): request = factories.TicketRequestFactory() factories.TicketMatchFactory(ticket_request=request, ticket_offer__is_terminated=True) assert_is_active(request)
def test_offer_is_active_with_expired_match(factories): offer = factories.TicketOfferFactory() factories.ExpiredTicketMatchFactory(ticket_offer=offer, ) assert_is_active(offer)