def test_inter_placeholder_plugin_move(self): ex = Example5(char_1='one', char_2='two', char_3='tree', char_4='four') ex.save() ph1 = ex.placeholder_1 ph2 = ex.placeholder_2 ph1_pl1 = add_plugin(ph1, TextPlugin, 'en', body='ph1 plugin1').cmsplugin_ptr ph1_pl2 = add_plugin(ph1, TextPlugin, 'en', body='ph1 plugin2').cmsplugin_ptr ph1_pl3 = add_plugin(ph1, TextPlugin, 'en', body='ph1 plugin3').cmsplugin_ptr ph2_pl1 = add_plugin(ph2, TextPlugin, 'en', body='ph2 plugin1').cmsplugin_ptr ph2_pl2 = add_plugin(ph2, TextPlugin, 'en', body='ph2 plugin2').cmsplugin_ptr ph2_pl3 = add_plugin(ph2, TextPlugin, 'en', body='ph2 plugin3').cmsplugin_ptr response = self.client.post( reverse('admin:placeholderapp_example5_move_plugin'), { 'placeholder': ph2.slot, 'placeholder_id': str(ph2.pk), 'plugin_id': str(ph1_pl2.pk), 'ids': "_".join( [str(p.pk) for p in [ph2_pl1, ph1_pl2, ph2_pl2, ph2_pl3]]) }) self.assertEqual(response.status_code, 200) self.assertEqual([ph1_pl1, ph1_pl3], list(ph1.cmsplugin_set.order_by('position'))) self.assertEqual([ph2_pl1, ph1_pl2, ph2_pl2, ph2_pl3], list(ph2.cmsplugin_set.order_by('position')))
def test_placeholder_tabs(self): ex = Example5( char_1='one', char_2='two', char_3='one', char_4='two', ) ex.save() user = self._testuser() self.client.login(username='******', password='******') response = self.client.get('/de/admin/placeholderapp/example5/1/') self.assertNotContains( response, """<input type="button" onclick="trigger_lang_button(this,'./?language=en');" class="language_button selected" id="debutton" name="en" value="English">""" )