本文整理汇总了Python中custom.ilsgateway.models.ILSGatewayConfig.domain方法的典型用法代码示例。如果您正苦于以下问题:Python ILSGatewayConfig.domain方法的具体用法?Python ILSGatewayConfig.domain怎么用?Python ILSGatewayConfig.domain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类custom.ilsgateway.models.ILSGatewayConfig
的用法示例。
在下文中一共展示了ILSGatewayConfig.domain方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from custom.ilsgateway.models import ILSGatewayConfig [as 别名]
# 或者: from custom.ilsgateway.models.ILSGatewayConfig import domain [as 别名]
def setUp(self):
self.endpoint = MockEndpoint("http://test-api.com/", "dummy", "dummy")
self.stock_api_object = MockILSStockDataSynchronization(TEST_DOMAIN, self.endpoint)
self.datapath = os.path.join(os.path.dirname(__file__), "data")
initial_bootstrap(TEST_DOMAIN)
self.api_object = ILSGatewayAPI(TEST_DOMAIN, self.endpoint)
self.api_object.prepare_commtrack_config()
config = ILSGatewayConfig()
config.domain = TEST_DOMAIN
config.enabled = True
config.all_stock_data = True
config.password = "dummy"
config.username = "dummy"
config.url = "http://test-api.com/"
config.save()
l1 = Location(name="Test location 1", external_id="3445", location_type="FACILITY", domain=TEST_DOMAIN)
l2 = Location(name="Test location 2", external_id="4407", location_type="FACILITY", domain=TEST_DOMAIN)
l1.save()
l2.save()
SupplyPointCase.create_from_location(TEST_DOMAIN, l1)
SupplyPointCase.create_from_location(TEST_DOMAIN, l2)
with open(os.path.join(self.datapath, "sample_products.json")) as f:
for product_json in json.loads(f.read()):
self.api_object.product_sync(Product(product_json))
StockTransaction.objects.all().delete()
示例2: setUp
# 需要导入模块: from custom.ilsgateway.models import ILSGatewayConfig [as 别名]
# 或者: from custom.ilsgateway.models.ILSGatewayConfig import domain [as 别名]
def setUp(self):
self.datapath = os.path.join(os.path.dirname(__file__), 'data')
initial_bootstrap(TEST_DOMAIN)
config = ILSGatewayConfig()
config.domain = TEST_DOMAIN
config.enabled = True
config.password = 'dummy'
config.username = 'dummy'
config.url = 'http://test-api.com/'
config.save()
for product in Product.by_domain(TEST_DOMAIN):
product.delete()
示例3: setUpClass
# 需要导入模块: from custom.ilsgateway.models import ILSGatewayConfig [as 别名]
# 或者: from custom.ilsgateway.models.ILSGatewayConfig import domain [as 别名]
def setUpClass(cls):
cls.datapath = os.path.join(os.path.dirname(__file__), 'data')
cls.sms_backend, cls.sms_backend_mapping = setup_default_sms_test_backend()
initial_bootstrap(TEST_DOMAIN)
config = ILSGatewayConfig()
config.domain = TEST_DOMAIN
config.enabled = True
config.password = 'dummy'
config.username = 'dummy'
config.url = 'http://test-api.com/'
config.save()
for product in Product.by_domain(TEST_DOMAIN):
product.delete()
示例4: setUp
# 需要导入模块: from custom.ilsgateway.models import ILSGatewayConfig [as 别名]
# 或者: from custom.ilsgateway.models.ILSGatewayConfig import domain [as 别名]
def setUp(self):
self.datapath = os.path.join(os.path.dirname(__file__), 'data')
initial_bootstrap(TEST_DOMAIN)
self.sms_backend = TestSMSBackend(name="MOBILE_BACKEND_TEST", is_global=True)
self.sms_backend._id = self.sms_backend.name
self.sms_backend.save()
config = ILSGatewayConfig()
config.domain = TEST_DOMAIN
config.enabled = True
config.password = 'dummy'
config.username = 'dummy'
config.url = 'http://test-api.com/'
config.save()
for product in Product.by_domain(TEST_DOMAIN):
product.delete()