def test_uninstall_plugins_with_plugin(self):
out = StringIO()
placeholder = Placeholder.objects.create(slot="test")
add_plugin(placeholder, TextPlugin, "en", body="en body")
self.assertEqual(CMSPlugin.objects.filter(plugin_type=PLUGIN).count(), 1)
management.call_command('cms', 'uninstall', 'plugins', PLUGIN, interactive=False, stdout=out)
self.assertEqual(out.getvalue(), "1 'TextPlugin' plugins uninstalled\n")
self.assertEqual(CMSPlugin.objects.filter(plugin_type=PLUGIN).count(), 0)
评论列表
文章目录