#NEWLINE# def test_get_plugins_for_page( self ) : #NEWLINE# #INDENT# page_en = api . create_page ( 'PluginOrderPage' , 'col_two.html' , 'en' , slug = 'page1' , published = True , in_navigation = True ) #NEWLINE# ph_en = page_en . placeholders . get ( slot = 'col_left' ) #NEWLINE# text_plugin_1 = api . add_plugin ( ph_en , 'TextPlugin' , 'en' , body = "I'm inside an existing placeholder." ) #NEWLINE# ph_en_not_used = page_en . placeholders . create ( slot = 'not_used' ) #NEWLINE# text_plugin_2 = api . add_plugin ( ph_en_not_used , 'TextPlugin' , 'en' , body = "I'm inside a non-existent placeholder." ) #NEWLINE# page_plugins = get_plugins_for_page ( None , page_en , page_en . get_title_obj_attribute ( 'language' ) ) #NEWLINE# db_text_plugin_1 = page_plugins . get ( pk = text_plugin_1 . pk ) #NEWLINE# self . assertRaises ( CMSPlugin . DoesNotExist , page_plugins . get , pk = text_plugin_2 . pk ) #NEWLINE# self . assertEqual ( db_text_plugin_1 . pk , self . pk )