我们从Python开源项目中,提取了以下28个代码示例,用于说明如何使用django.core.checks.run_checks()。
def _run_checks(self, **kwargs): return checks.run_checks(**kwargs)
def _run_checks(self, **kwargs): issues = run_checks(tags=[Tags.database]) issues.extend(super(Command, self)._run_checks(**kwargs)) return issues
def test_models_check(self): self.maxDiff = None app_configs = [apps.get_app_config("testapp")] all_issues = checks.run_checks( app_configs=app_configs, tags=None, include_deployment_checks=False, ) self.assertListEqual(all_issues, [])
def test_field_check_errors(self): with self.settings(INSTALLED_APPS=settings.INSTALLED_APPS + ("broken_test_app",)): self.maxDiff = None app_configs = [apps.get_app_config("broken_test_app")] all_issues = checks.run_checks( app_configs=app_configs, tags=None, include_deployment_checks=False, ) self.assertListEqual([issue.id for issue in all_issues], [ 'compositefk.E001', 'compositefk.E002', 'compositefk.E003', 'compositefk.E003', 'compositefk.E004', 'compositefk.E006', 'compositefk.E005' ])