示例#1
0
def test_load_module():
    with override_settings(INSTALLED_APPS=["shuup_tests.core"],
                           MODULE_TEST_MODULE="mtm1"):
        mtm = load_module("MODULE_TEST_MODULE", "module_test_module")
        assert mtm.greeting == "Hello"

    with override_settings(INSTALLED_APPS=["shuup_tests.core"],
                           MODULE_TEST_MODULE="mtm2"):
        mtm = load_module("MODULE_TEST_MODULE", "module_test_module")
        assert mtm.greeting == "Hola"

    with override_settings(MODULE_TEST_MODULE="mtm2"):
        with pytest.raises(ImproperlyConfigured):
            load_module("MODULE_TEST_MODULE", "module_test_module")
示例#2
0
文件: _module.py 项目: zarlant/shuup
def get_tax_module():
    """
    Get the TaxModule specified in settings.

    :rtype: shuup.core.taxing.TaxModule
    """
    return load_module("SHUUP_TAX_MODULE", "tax_module")()
示例#3
0
文件: _module.py 项目: gurch101/shuup
def get_tax_module():
    """
    Get the TaxModule specified in settings.

    :rtype: shuup.core.taxing.TaxModule
    """
    return load_module("SHUUP_TAX_MODULE", "tax_module")()
示例#4
0
def test_load_module():
    with override_settings(
        INSTALLED_APPS=["shuup_tests.core"],
        MODULE_TEST_MODULE="mtm1"
    ):
        mtm = load_module("MODULE_TEST_MODULE", "module_test_module")
        assert mtm.greeting == "Hello"

    with override_settings(
        INSTALLED_APPS=["shuup_tests.core"],
        MODULE_TEST_MODULE="mtm2"
    ):
        mtm = load_module("MODULE_TEST_MODULE", "module_test_module")
        assert mtm.greeting == "Hola"

    with override_settings(
        MODULE_TEST_MODULE="mtm2"
    ):
        with pytest.raises(ImproperlyConfigured):
            load_module("MODULE_TEST_MODULE", "module_test_module")
示例#5
0
def get_pricing_module():
    """
    :rtype: shuup.core.pricing.PricingModule
    """
    return load_module("SHUUP_PRICING_MODULE", "pricing_module")()
示例#6
0
def get_pricing_module():
    """
    :rtype: shuup.core.pricing.PricingModule
    """
    return load_module("SHUUP_PRICING_MODULE", "pricing_module")()