本文整理汇总了Python中shoop_tests.utils.basketish_order_source.BasketishOrderSource.lines方法的典型用法代码示例。如果您正苦于以下问题:Python BasketishOrderSource.lines方法的具体用法?Python BasketishOrderSource.lines怎么用?Python BasketishOrderSource.lines使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shoop_tests.utils.basketish_order_source.BasketishOrderSource
的用法示例。
在下文中一共展示了BasketishOrderSource.lines方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_weight_limits
# 需要导入模块: from shoop_tests.utils.basketish_order_source import BasketishOrderSource [as 别名]
# 或者: from shoop_tests.utils.basketish_order_source.BasketishOrderSource import lines [as 别名]
def test_weight_limits():
sm = ShippingMethod(tax_class=get_default_tax_class())
sm.module_data = {"min_weight": "100", "max_weight": "500"}
source = BasketishOrderSource()
assert any(ve.code == "min_weight" for ve in sm.get_validation_errors(source))
source.lines = [SourceLine(type=OrderLineType.PRODUCT, weight=600)]
assert any(ve.code == "max_weight" for ve in sm.get_validation_errors(source))
示例2: test_waiver
# 需要导入模块: from shoop_tests.utils.basketish_order_source import BasketishOrderSource [as 别名]
# 或者: from shoop_tests.utils.basketish_order_source.BasketishOrderSource import lines [as 别名]
def test_waiver():
sm = ShippingMethod(
name="Waivey",
tax_class=get_default_tax_class(),
module_data={"price_waiver_product_minimum": "370", "price": "100"},
)
source = BasketishOrderSource()
assert not source.prices_include_tax()
assert sm.get_effective_name(source) == u"Waivey"
assert sm.get_effective_price(source) == TaxlessPrice(100)
source.lines = [
SourceLine(type=OrderLineType.PRODUCT, product=get_default_product(), unit_price=TaxlessPrice(400), quantity=1)
]
assert sm.get_effective_price(source) == TaxlessPrice(0)