def _clear_edit_handler_cache(self):
    '\n        These tests generate new EditHandlers with different settings. The\n        cached edit handlers should be cleared before and after each test run\n        to ensure that no changes leak through to other tests.\n        '
    from wagtail.tests.testapp.models import DefaultRichBlockFieldPage
    block_page_edit_handler = DefaultRichBlockFieldPage.get_edit_handler()
    if block_page_edit_handler._form_class:
        rich_text_block = block_page_edit_handler._form_class.base_fields['body'].block.child_blocks['rich_text']
        if hasattr(rich_text_block, 'field'):
            del rich_text_block.field
    for page_class in get_page_models():
        page_class.get_edit_handler.cache_clear()
These tests generate new EditHandlers with different settings. The
cached edit handlers should be cleared before and after each test run
to ensure that no changes leak through to other tests.
def _clear_edit_handler_cache(self):
    '\n        These tests generate new EditHandlers with different settings. The\n        cached edit handlers should be cleared before and after each test run\n        to ensure that no changes leak through to other tests.\n        '
    from wagtail.tests.testapp.models import DefaultRichBlockFieldPage
    block_page_edit_handler = DefaultRichBlockFieldPage.get_edit_handler()
    if block_page_edit_handler._form_class:
        rich_text_block = block_page_edit_handler._form_class.base_fields['body'].block.child_blocks['rich_text']
        if hasattr(rich_text_block, 'field'):
            del rich_text_block.field
    for page_class in get_page_models():
        page_class.get_edit_handler.cache_clear()