'This is the test for the low-level code that caused the bug:
the placeholder scan corrupts the nodelist of the extends node,
which is retained by the cached template loader, and future
renders of that template will render the super block twice.'

@override_settings(TEMPLATE_LOADERS=(('django.template.loaders.cached.Loader', ('django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader')),))
def test_cached_template_not_corrupted_by_placeholder_scan(self):

    nodelist = _get_nodelist(get_template('placeholder_tests/test_super_extends_2.html'))
    self.assertNotIn('one', nodelist[0].blocks.keys(), "test_super_extends_1.html    contains    a    block    called    'one',    but    _2.html    does    not.")
    _get_placeholder_slots('placeholder_tests/test_super_extends_2.html')
    nodelist = _get_nodelist(get_template('placeholder_tests/test_super_extends_2.html'))
    self.assertNotIn('one', nodelist[0].blocks.keys(), "test_super_extends_1.html    still    should    not    contain    a    block    called    'one'    after    rescanning    placeholders.")
