def valid(self, order=None):
        if order:
            quants = [item.quantity for item in order.orderitem_set.all() if item.product.is_shippable]
            if quants:
                qty = reduce(operator.add, quants)
            else:
                qty = Decimal('0')
                                                
        elif self.cart:
            qty = self.cart.numItems

        try:
            price = self.carrier.price(qty)
            
        except TieredPriceException:
            return False
                        
        return True
L{_iterateTests} returns tests in left-to-right, depth-first order.
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/shipping/modules/tieredquantity/models.py/Shipper.valid--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/trial/test/test_tests.py/TestIterateTests.test_iterateIsLeftToRightDepthFirst