#NEWLINE# def test_add_edit_plugin( self ) : #NEWLINE# #INDENT# from cms.test_utils.project.mti_pluginapp.models import TestPluginBetaModel #NEWLINE# '\n        Test that we can instantiate and use a MTI plugin\n        ' #NEWLINE# page = create_page ( 'Test' , 'nav_playground.html' , settings . LANGUAGES [ 0 ] [ 0 ] ) #NEWLINE# placeholder = page . placeholders . get ( slot = 'body' ) #NEWLINE# add_url = ( ( URL_CMS_PLUGIN_ADD + '?' ) + urlencode ( { #NEWLINE# #INDENT# 'plugin_type' : 'TestPluginBeta' , #NEWLINE# 'plugin_language' : settings . LANGUAGES [ 0 ] [ 0 ] , #NEWLINE# 'placeholder_id' : placeholder . pk , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# data = { #NEWLINE# #INDENT# 'alpha' : 'ALPHA' , #NEWLINE# 'beta' : 'BETA' , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( add_url , data ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# self . assertEqual ( TestPluginBetaModel . objects . count ( ) , 1 ) #NEWLINE# plugin_model = TestPluginBetaModel . objects . all ( ) [ 0 ] #NEWLINE# self . assertEqual ( 'ALPHA' , self . alpha ) #NEWLINE# self . assertEqual ( 'BETA' , plugin_model . beta )