#NEWLINE# def test_plugin_copy_with_reload( self ) : #NEWLINE# #INDENT# action_options = { #NEWLINE# #INDENT# PLUGIN_MOVE_ACTION : { #NEWLINE# #INDENT# 'requires_reload' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# PLUGIN_COPY_ACTION : { #NEWLINE# #INDENT# 'requires_reload' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# non_reload_action_options = { #NEWLINE# #INDENT# PLUGIN_MOVE_ACTION : { #NEWLINE# #INDENT# 'requires_reload' : False , #NEWLINE# #UNINDENT# } , #NEWLINE# PLUGIN_COPY_ACTION : { #NEWLINE# #INDENT# 'requires_reload' : False , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# ReloadDrivenPlugin = type ( 'ReloadDrivenPlugin' , ( CMSPluginBase , ) , dict ( action_options = action_options , render_plugin = False ) ) #NEWLINE# NonReloadDrivenPlugin = type ( 'NonReloadDrivenPlugin' , ( CMSPluginBase , ) , dict ( action_options = non_reload_action_options , render_plugin = False ) ) #NEWLINE# with register_plugins ( ReloadDrivenPlugin , NonReloadDrivenPlugin ) : #NEWLINE# #INDENT# page = api . create_page ( 'page' , 'nav_playground.html' , 'en' , published = True ) #NEWLINE# source_placeholder = page . placeholders . get ( slot = 'body' ) #NEWLINE# target_placeholder = page . placeholders . get ( slot = 'right-column' ) #NEWLINE# api . add_plugin ( source_placeholder , ReloadDrivenPlugin , settings . LANGUAGES [ 0 ] [ 0 ] ) #NEWLINE# plugin_2 = api . add_plugin ( source_placeholder , NonReloadDrivenPlugin , settings . LANGUAGES [ 0 ] [ 0 ] ) #NEWLINE# copy_data = { #NEWLINE# #INDENT# 'source_placeholder_id' : source_placeholder . pk , #NEWLINE# 'target_placeholder_id' : target_placeholder . pk , #NEWLINE# 'target_language' : settings . LANGUAGES [ 0 ] [ 0 ] , #NEWLINE# 'source_language' : settings . LANGUAGES [ 0 ] [ 0 ] , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( ( URL_CMS_PAGE + 'copy-plugins/' ) , copy_data ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# json_response = json . loads ( response . content . decode ( 'utf8' ) ) #NEWLINE# self . assertEqual ( json_response [ 'reload' ] , True ) #NEWLINE# copy_data = { #NEWLINE# #INDENT# 'source_placeholder_id' : source_placeholder . pk , #NEWLINE# 'source_plugin_id' : plugin_2 . pk , #NEWLINE# 'target_placeholder_id' : ReloadDrivenPlugin . pk , #NEWLINE# 'target_language' : settings . LANGUAGES [ 0 ] [ 0 ] , #NEWLINE# 'source_language' : settings . LANGUAGES [ 0 ] [ 0 ] , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( ( URL_CMS_PAGE + 'copy-plugins/' ) , copy_data ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# json_response = json . loads ( response . content . decode ( 'utf8' ) ) #NEWLINE# self . assertEqual ( json_response [ 'reload' ] , False )