#NEWLINE# def test_plugin_loading_queries( self ) : #NEWLINE# #INDENT# with self . settings ( CMS_TEMPLATES = ( ( 'placeholder_tests/base.html' , 'tpl' ) , ) ) : #NEWLINE# #INDENT# page = create_page ( 'home' , 'placeholder_tests/base.html' , 'en' , published = True , slug = 'home' ) #NEWLINE# placeholders = list ( page . placeholders . all ( ) ) #NEWLINE# for ( i , placeholder ) in enumerate ( placeholders ) : #NEWLINE# #INDENT# for j in range ( 5 ) : #NEWLINE# #INDENT# add_plugin ( placeholder , TextPlugin , 'en' , body = ( 'text-%d-%d' % ( i , j ) ) ) #NEWLINE# add_plugin ( placeholder , LinkPlugin , 'en' , name = ( 'link-%d-%d' % ( i , j ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# reverse ( 'pages-root' ) #NEWLINE# context = self . get_context ( page = page ) #NEWLINE# context [ 'request' ] . current_page . get_languages ( ) #NEWLINE# with self . assertNumQueries ( 4 ) : #NEWLINE# #INDENT# for ( i , placeholder ) in enumerate ( placeholders ) : #NEWLINE# #INDENT# content = get_placeholder_content ( context , context [ 'request' ] , page , placeholder . slot , False , None ) #NEWLINE# for j in range ( 5 ) : #NEWLINE# #INDENT# self . assertIn ( ( 'text-%d-%d' % ( i , j ) ) , content ) #NEWLINE# self . assertIn ( ( 'link-%d-%d' % ( i , j ) ) , content )