当前位置: 首页>>代码示例>>Python>>正文


Python template_rendered.connect方法代码示例

本文整理汇总了Python中django.test.signals.template_rendered.connect方法的典型用法代码示例。如果您正苦于以下问题:Python template_rendered.connect方法的具体用法?Python template_rendered.connect怎么用?Python template_rendered.connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在django.test.signals.template_rendered的用法示例。


在下文中一共展示了template_rendered.connect方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_test_databases

# 需要导入模块: from django.test.signals import template_rendered [as 别名]
# 或者: from django.test.signals.template_rendered import connect [as 别名]
def create_test_databases(worker_id: int) -> None:
    database_id = get_database_id(worker_id)
    for alias in connections:
        connection = connections[alias]
        connection.creation.clone_test_db(
            suffix=database_id,
            keepdb=True,
        )

        settings_dict = connection.creation.get_test_db_clone_settings(database_id)
        # connection.settings_dict must be updated in place for changes to be
        # reflected in django.db.connections. If the following line assigned
        # connection.settings_dict = settings_dict, new threads would connect
        # to the default database instead of the appropriate clone.
        connection.settings_dict.update(settings_dict)
        connection.close() 
开发者ID:zulip,项目名称:zulip,代码行数:18,代码来源:test_runner.py

示例2: __enter__

# 需要导入模块: from django.test.signals import template_rendered [as 别名]
# 或者: from django.test.signals.template_rendered import connect [as 别名]
def __enter__(self):
        template_rendered.connect(self.on_template_render)
        return self 
开发者ID:lanbing510,项目名称:GTDWeb,代码行数:5,代码来源:testcases.py

示例3: __init__

# 需要导入模块: from django.test.signals import template_rendered [as 别名]
# 或者: from django.test.signals.template_rendered import connect [as 别名]
def __init__(self, *args: Any, **kwargs: Any) -> None:
        DiscoverRunner.__init__(self, *args, **kwargs)

        # `templates_rendered` holds templates which were rendered
        # in proper logical tests.
        self.templates_rendered: Set[str] = set()
        # `shallow_tested_templates` holds templates which were rendered
        # in `zerver.tests.test_templates`.
        self.shallow_tested_templates: Set[str] = set()
        template_rendered.connect(self.on_template_rendered) 
开发者ID:zulip,项目名称:zulip,代码行数:12,代码来源:test_runner.py

示例4: __exit__

# 需要导入模块: from django.test.signals import template_rendered [as 别名]
# 或者: from django.test.signals.template_rendered import connect [as 别名]
def __exit__(self, exc_type, exc_value, traceback):
        self.connection.use_debug_cursor = self.old_debug_cursor
        request_started.connect(reset_queries)
        if exc_type is not None:
            return

        final_queries = len(self.connection.queries)
        executed = final_queries - self.starting_queries

        self.test_case.assertEqual(
            executed, self.num, "%d queries executed, %d expected" % (
                executed, self.num
            )
        ) 
开发者ID:blackye,项目名称:luscan-devel,代码行数:16,代码来源:testcases.py

示例5: __init__

# 需要导入模块: from django.test.signals import template_rendered [as 别名]
# 或者: from django.test.signals.template_rendered import connect [as 别名]
def __init__(self, *args, **kwargs):
        super(self.__class__, self).__init__(*args, **kwargs)
        self.templates = []
        template_rendered.connect(self._store_template_info) 
开发者ID:canvasnetworks,项目名称:canvas,代码行数:6,代码来源:template.py


注:本文中的django.test.signals.template_rendered.connect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。