misc: add setting to force synchronous rendering of cells (#49149)
The setting is used through a new fixture, `synchronous_cells`. It's necessary to test views with cells which always use ajax rendering without an headless browser or using the request factory.
This commit is contained in:
parent
99a912e255
commit
5b5d046414
|
@ -591,6 +591,8 @@ def publish_page(request, page, status=200, template_name=None):
|
|||
}
|
||||
ctx.update(getattr(request, 'extra_context_data', {}))
|
||||
modify_global_context(request, ctx)
|
||||
if getattr(settings, 'COMBO_TEST_ALWAYS_RENDER_CELLS_SYNCHRONOUSLY', False):
|
||||
ctx['synchronous'] = True
|
||||
|
||||
for cell in cells:
|
||||
if cell.modify_global_context:
|
||||
|
|
|
@ -57,3 +57,8 @@ def nocache(settings):
|
|||
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def synchronous_cells(settings):
|
||||
settings.COMBO_TEST_ALWAYS_RENDER_CELLS_SYNCHRONOUSLY = True
|
||||
|
|
Loading…
Reference in New Issue