本文整理匯總了Python中celery.fixups.django.DjangoFixup類的典型用法代碼示例。如果您正苦於以下問題:Python DjangoFixup類的具體用法?Python DjangoFixup怎麽用?Python DjangoFixup使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了DjangoFixup類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_autodiscover_tasks
def test_autodiscover_tasks(self, patching):
patching.modules('django.apps')
from django.apps import apps
f = DjangoFixup(self.app)
configs = [Mock(name='c1'), Mock(name='c2')]
apps.get_app_configs.return_value = configs
assert f.autodiscover_tasks() == [c.name for c in configs]
示例2: test_autodiscover_tasks
def test_autodiscover_tasks(self):
self.mock_modules('django.apps')
from django.apps import apps
f = DjangoFixup(self.app)
configs = [Mock(name='c1'), Mock(name='c2')]
apps.get_app_configs.return_value = configs
self.assertEqual(
f.autodiscover_tasks(),
[c.name for c in configs],
)
示例3: test_on_import_modules
def test_on_import_modules(self):
f = DjangoFixup(self.app)
f.worker_fixup = Mock(name='worker_fixup')
f.on_import_modules()
f.worker_fixup.validate_models.assert_called_with()
示例4: test_worker_fixup_property
def test_worker_fixup_property(self, DjangoWorkerFixup):
f = DjangoFixup(self.app)
f._worker_fixup = None
assert f.worker_fixup is DjangoWorkerFixup()
assert f.worker_fixup is DjangoWorkerFixup()
示例5: test_autodiscover_tasks_pre17
def test_autodiscover_tasks_pre17(self):
self.mask_modules('django.apps')
f = DjangoFixup(self.app)
f._settings = Mock(name='_settings')
self.assertIs(f.autodiscover_tasks(), f._settings.INSTALLED_APPS)
示例6: test_worker_fixup_property
def test_worker_fixup_property(self, DjangoWorkerFixup):
f = DjangoFixup(self.app)
f._worker_fixup = None
self.assertIs(f.worker_fixup, DjangoWorkerFixup())
self.assertIs(f.worker_fixup, DjangoWorkerFixup())