本文整理汇总了Python中custom.ilsgateway.models.ILSGatewayConfig.all_stock_data方法的典型用法代码示例。如果您正苦于以下问题:Python ILSGatewayConfig.all_stock_data方法的具体用法?Python ILSGatewayConfig.all_stock_data怎么用?Python ILSGatewayConfig.all_stock_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类custom.ilsgateway.models.ILSGatewayConfig
的用法示例。
在下文中一共展示了ILSGatewayConfig.all_stock_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from custom.ilsgateway.models import ILSGatewayConfig [as 别名]
# 或者: from custom.ilsgateway.models.ILSGatewayConfig import all_stock_data [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()