def test_pricing_module_is_active():
 shop = Shop(currency='USD', prices_include_tax=False)
 customer = AnonymousContact()
 product = Product(sku='6.0745')
 pricing_mod = get_pricing_module()
 pricing_ctx = pricing_mod.get_context_from_data(shop, customer)
 pi = product.get_price_info(pricing_ctx, quantity=2)
 price = shop.create_price
 assert (pi.price == price('12.149'))
 assert (pi.base_price == price('48.596'))
 assert (pi.quantity == 2)
 assert (pi.discounted_unit_price == price('6.0745'))
 assert (pi.base_unit_price == price('24.298'))
 assert (pi.discount_rate == Decimal('0.75'))

def test_pricing_module_is_active ( ) : shop = Shop ( currency = 'USD' , prices_include_tax = False ) customer = AnonymousContact ( ) product = Product ( sku = '6.0745' ) pricing_mod = get_pricing_module ( ) pricing_ctx = pricing_mod . get_context_from_data ( shop , customer ) pi = product . get_price_info ( pricing_ctx , quantity = 2 ) price = shop . create_price assert ( pi . price == price ( '12.149' ) ) assert ( pi . base_price == price ( '48.596' ) ) assert ( pi . quantity == 2 ) assert ( pi . discounted_unit_price == price ( '6.0745' ) ) assert ( pi . base_unit_price == price ( '24.298' ) ) assert ( pi . discount_rate == Decimal ( '0.75' ) )
make sure that our custom pricing module is active .