def test_load_module(): with override_settings(INSTALLED_APPS=["shoop_tests.core"], MODULE_TEST_MODULE="mtm1"): mtm = load_module("MODULE_TEST_MODULE", "module_test_module") assert mtm.greeting == "Hello" with override_settings(INSTALLED_APPS=["shoop_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")
def get_tax_module(): """ Get the TaxModule specified in settings. :rtype: shoop.core.taxing.TaxModule """ return load_module("SHOOP_TAX_MODULE", "tax_module")()
def test_load_module(): with override_settings( INSTALLED_APPS=["shoop_tests.core"], MODULE_TEST_MODULE="mtm1" ): mtm = load_module("MODULE_TEST_MODULE", "module_test_module") assert mtm.greeting == "Hello" with override_settings( INSTALLED_APPS=["shoop_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")
def get_pricing_module(): """ :rtype: shoop.core.pricing.PricingModule """ return load_module("SHOOP_PRICING_MODULE", "pricing_module")()