MCPcopy
hub / github.com/django/django / run_setup

Method run_setup

tests/apps/tests.py:631–647  ·  view source on GitHub ↗
(self, app_config_name)

Source from the content-addressed store, hash-verified

629 editor.remove_procedure("test_procedure")
630
631 def run_setup(self, app_config_name):
632 custom_settings = override_settings(
633 INSTALLED_APPS=[f"apps.query_performing_app.apps.{app_config_name}"]
634 )
635 custom_settings.enable()
636 old_stored_app_configs = apps.stored_app_configs
637 apps.stored_app_configs = []
638 try:
639 with patch.multiple(apps, ready=False, loading=False, app_configs={}):
640 with self.assertWarnsMessage(RuntimeWarning, self.expected_msg):
641 django.setup()
642
643 app_config = apps.get_app_config("query_performing_app")
644 return app_config.query_results
645 finally:
646 setattr(apps, "stored_app_configs", old_stored_app_configs)
647 custom_settings.disable()

Calls 6

override_settingsClass · 0.90
assertWarnsMessageMethod · 0.80
get_app_configMethod · 0.80
enableMethod · 0.45
setupMethod · 0.45
disableMethod · 0.45

Tested by

no test coverage detected