本文整理汇总了Python中corehq.apps.userreports.models.StaticDataSourceConfiguration.wrap方法的典型用法代码示例。如果您正苦于以下问题:Python StaticDataSourceConfiguration.wrap方法的具体用法?Python StaticDataSourceConfiguration.wrap怎么用?Python StaticDataSourceConfiguration.wrap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corehq.apps.userreports.models.StaticDataSourceConfiguration
的用法示例。
在下文中一共展示了StaticDataSourceConfiguration.wrap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUpClass
# 需要导入模块: from corehq.apps.userreports.models import StaticDataSourceConfiguration [as 别名]
# 或者: from corehq.apps.userreports.models.StaticDataSourceConfiguration import wrap [as 别名]
def setUpClass(cls):
super(BaseICDSDatasourceTest, cls).setUpClass()
cls._call_center_domain_mock.start()
cls.static_datasource = StaticDataSourceConfiguration.wrap(
cls.get_json(cls.datasource_filename)
)
cls.domain = cls.static_datasource.domains[0]
cls.datasource = StaticDataSourceConfiguration._get_datasource_config(
cls.static_datasource,
cls.domain,
)
cls.casefactory = CaseFactory(domain=cls.domain)
cls.adapter = get_indicator_adapter(cls.datasource)
cls.adapter.rebuild_table()
示例2: test_wrap
# 需要导入模块: from corehq.apps.userreports.models import StaticDataSourceConfiguration [as 别名]
# 或者: from corehq.apps.userreports.models.StaticDataSourceConfiguration import wrap [as 别名]
def test_wrap(self):
wrapped = StaticDataSourceConfiguration.wrap(self.get_json('sample_static_data_source'))
self.assertEqual(["example", "dimagi"], wrapped.domains)
示例3: _get_ds
# 需要导入模块: from corehq.apps.userreports.models import StaticDataSourceConfiguration [as 别名]
# 或者: from corehq.apps.userreports.models.StaticDataSourceConfiguration import wrap [as 别名]
def _get_ds(ds_domains, data_source_path):
data_source_json = _get_json(data_source_path)
data_source_json['domains'] = ds_domains
data_source_json['server_environment'] = [settings.SERVER_ENVIRONMENT]
ds_conf = StaticDataSourceConfiguration.wrap(deepcopy(data_source_json))
return ds_conf, data_source_path