Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(24)  |  Call(23)  |  Derive(0)  |  Import(1)

src/d/j/django-oscar-HEAD/tests/integration/offer/priority_offers_tests.py   django-oscar(Download)
    def test_site_offers_are_ordered(self):
        factories.create_offer(name="A", priority=0)
        factories.create_offer(name="B", priority=7)
        factories.create_offer(name="C", priority=5)
        factories.create_offer(name="D", priority=7)
        factories.create_offer(name="E", priority=1)

src/d/j/django-oscar-HEAD/tests/integration/order/creator_tests.py   django-oscar(Download)
        benefit = Benefit.objects.create(
            range=range, type=Benefit.SHIPPING_PERCENTAGE, value=20)
        offer = factories.create_offer(range=range, benefit=benefit)
        Applicator().apply_offers(self.basket, [offer])
 

src/d/j/django-oscar-HEAD/tests/integration/offer/manager_tests.py   django-oscar(Download)
        start = now - datetime.timedelta(days=1)
        end = now + datetime.timedelta(days=1)
        factories.create_offer(start=start, end=end)
 
        filtered_offers = models.ConditionalOffer.active.all()
        start = now - datetime.timedelta(days=3)
        end = now - datetime.timedelta(days=1)
        factories.create_offer(start=start, end=end)
 
        filtered_offers = models.ConditionalOffer.active.all()
        start = now + datetime.timedelta(days=1)
        end = now + datetime.timedelta(days=3)
        factories.create_offer(start=start, end=end)
 
        filtered_offers = models.ConditionalOffer.active.all()
    def test_filters_out_suspended_offers(self):
        # Create offer that is available but with the wrong status
        factories.create_offer(
            status=models.ConditionalOffer.SUSPENDED)
        filtered_offers = models.ConditionalOffer.active.all()

src/d/j/django-oscar-HEAD/tests/integration/order/model_tests.py   django-oscar(Download)
from oscar.apps.order.exceptions import (InvalidOrderStatus, InvalidLineStatus,
                                         InvalidShippingEvent)
from oscar.test.factories import create_order, create_offer, create_voucher, create_basket
from oscar.test.basket import add_product
 
    def test_can_be_created_with_an_offer(self):
        offer = create_offer()
        order = create_order(number='100002')
        discount = OrderDiscount.objects.create(order=order, amount=D('10.00'),
                                                offer_id=offer.id)
        self.assertEqual(offer.id, discount.offer.id)
        self.assertEqual(offer.name, discount.offer_name)
 
    def test_can_be_created_with_an_offer_and_specified_offer_name(self):
        offer = create_offer(name="My offer")
    def test_contains_offer_details_after_offer_is_deleted(self):
        offer = create_offer(name="Get 200% off")
        order = create_order(number='100002')
        discount = OrderDiscount.objects.create(order=order, amount=D('10.00'),
                                                offer_id=offer.id)

src/d/j/django-oscar-HEAD/tests/functional/dashboard/offer_tests.py   django-oscar(Download)
    def test_can_update_an_existing_offer(self):
        factories.create_offer(name="Offer A")
 
        list_page = self.get(reverse('dashboard:offer-list'))
        detail_page = list_page.click('Offer A')
    def test_can_jump_to_intermediate_step_for_existing_offer(self):
        offer = factories.create_offer()
        url = reverse('dashboard:offer-condition',
                      kwargs={'pk': offer.id})
        self.assertEqual(200, self.get(url).status_code)
    def test_can_suspend_an_offer(self):
        # Create an offer
        offer = factories.create_offer()
        self.assertFalse(offer.is_suspended)
 
    def test_can_reinstate_a_suspended_offer(self):
        # Create a suspended offer
        offer = factories.create_offer()
        offer.suspend()
        self.assertTrue(offer.is_suspended)

src/d/j/django-oscar-HEAD/tests/functional/checkout/customer_checkout_tests.py   django-oscar(Download)
    def test_records_use(self):
        offer = factories.create_offer()
        self.add_product_to_basket()
        self.enter_shipping_address()
        self.place_order()