當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。