#NEWLINE# def test_deep_copy_plugins( self ) : #NEWLINE# #INDENT# page_en = api . create_page ( 'CopyPluginTestPage (EN)' , 'nav_playground.html' , 'en' ) #NEWLINE# ph_en = page_en . placeholders . get ( slot = 'body' ) #NEWLINE# mcol1_en = api . add_plugin ( ph_en , 'MultiColumnPlugin' , 'en' , position = 'first-child' ) #NEWLINE# col1_en = api . add_plugin ( ph_en , 'ColumnPlugin' , 'en' , position = 'first-child' , target = mcol1_en ) #NEWLINE# col2_en = api . add_plugin ( ph_en , 'ColumnPlugin' , 'en' , position = 'first-child' , target = mcol1_en ) #NEWLINE# link_plugin_en = api . add_plugin ( ph_en , 'LinkPlugin' , 'en' , target = col2_en , name = 'A Link' , url = 'https://www.django-cms.org' ) #NEWLINE# old_plugins = [ mcol1_en , col1_en , col2_en , link_plugin_en ] #NEWLINE# page_de = api . create_page ( 'CopyPluginTestPage (DE)' , 'nav_playground.html' , 'de' ) #NEWLINE# ph_de = page_de . placeholders . get ( slot = 'body' ) #NEWLINE# mcol1_de = api . add_plugin ( ph_de , 'MultiColumnPlugin' , 'de' , position = 'first-child' ) #NEWLINE# col1_de = api . add_plugin ( ph_de , 'ColumnPlugin' , 'de' , position = 'first-child' , target = mcol1_de ) #NEWLINE# copy_plugins_to ( old_plugins = [ mcol1_en , col1_en , col2_en , link_plugin_en ] , to_placeholder = ph_de , to_language = 'de' , parent_plugin_id = col1_de . pk ) #NEWLINE# col1_de = self . reload ( col1_de ) #NEWLINE# new_plugins = col1_de . get_descendants ( ) . order_by ( 'path' ) #NEWLINE# self . assertEqual ( new_plugins . count ( ) , len ( old_plugins ) ) #NEWLINE# for ( old_plugin , new_plugin ) in zip ( old_plugins , new_plugins ) : #NEWLINE# #INDENT# self . assertEqual ( old_plugin . numchild , new_plugin . numchild ) #NEWLINE# #UNINDENT# with self . assertNumQueries ( FuzzyInt ( 0 , 207 ) ) : #NEWLINE# #INDENT# page_en . publish ( 'en' )