'Various checks here:
* plugins are exactly doubled, half per language with no orphaned plugin
* the bottom-most plugins in the nesting chain maintain the same position and the same content
* the top-most plugin are of the same type'

def test_copy_langs(self):

    site = 1
    number_start_plugins = CMSPlugin.objects.all().count()
    out = StringIO()
    management.call_command(u'cms', u'copy', u'lang', u'--from-lang=en', u'--to-lang=de', interactive=False, stdout=out)
    pages = Page.objects.on_site(site).drafts()
    for page in pages:
        self.assertEqual(set((u'en', u'de')), set(page.get_languages()))
    self.assertEqual(CMSPlugin.objects.all().count(), (number_start_plugins * 2))
    self.assertEqual(CMSPlugin.objects.filter(language=u'en').count(), number_start_plugins)
    self.assertEqual(CMSPlugin.objects.filter(language=u'de').count(), number_start_plugins)
    root_page = Page.objects.on_site(site).get_home()
    root_plugins = CMSPlugin.objects.filter(placeholder=root_page.placeholders.get(slot=u'body'))
    (first_plugin_en, _) = root_plugins.get(language=u'en', parent=None).get_plugin_instance()
    (first_plugin_de, _) = root_plugins.get(language=u'de', parent=None).get_plugin_instance()
    self.assertEqual(first_plugin_en.plugin_type, first_plugin_de.plugin_type)
    (link_en, _) = root_plugins.get(language=u'en', plugin_type=u'LinkPlugin').get_plugin_instance()
    (link_de, _) = root_plugins.get(language=u'de', plugin_type=u'LinkPlugin').get_plugin_instance()
    self.assertEqual(link_en.external_link, link_de.external_link)
    self.assertEqual(link_en.get_position_in_placeholder(), link_de.get_position_in_placeholder())
    stack_plugins = CMSPlugin.objects.filter(placeholder=StaticPlaceholder.objects.order_by(u'?')[0].draft)
    (stack_text_en, _) = stack_plugins.get(language=u'en', plugin_type=u'TextPlugin').get_plugin_instance()
    (stack_text_de, _) = stack_plugins.get(language=u'de', plugin_type=u'TextPlugin').get_plugin_instance()
    self.assertEqual(stack_text_en.plugin_type, stack_text_de.plugin_type)
    self.assertEqual(stack_text_en.body, stack_text_de.body)
