Пример #1
0
    def test_is_duplicate_seat_attempt__seats(self):
        """ Verify we get a correct response for duplicate seat check (seats) """
        product_type_seat = ProductClass.objects.create(name='Seat')
        product1 = ProductFactory(stockrecords__partner__short_code='test1', product_class=product_type_seat)
        product2 = ProductFactory(stockrecords__partner__short_code='test2', product_class=product_type_seat)
        seat_basket = prepare_basket(self.request, [product1])
        result_product1 = is_duplicate_seat_attempt(seat_basket, product1)
        result_product2 = is_duplicate_seat_attempt(seat_basket, product2)

        self.assertTrue(result_product1)
        self.assertFalse(result_product2)
Пример #2
0
    def test_is_duplicate_seat_attempt__enrollment_code(self):
        """ Verify we get a correct response for duplicate seat check (false for Enrollment code)"""
        enrollment_class = ProductClass.objects.create(name='Enrollment Code')
        enrollment_product = ProductFactory(stockrecords__partner__short_code='test3', product_class=enrollment_class)
        basket_with_enrollment_code = prepare_basket(self.request, [enrollment_product])
        result_product3 = is_duplicate_seat_attempt(basket_with_enrollment_code, enrollment_product)

        self.assertFalse(result_product3)