'Various checks here:
* plugins are exactly doubled, half per site 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_sites(self):

    site_1_pk = 1
    site_2 = Site.objects.create(name=u'site    2')
    site_2_pk = site_2.pk
    phs = []
    for page in Page.objects.on_site(site_1_pk).drafts():
        phs.extend(page.placeholders.values_list(u'pk', flat=True))
    number_start_plugins = CMSPlugin.objects.filter(placeholder__in=phs).count()
    out = StringIO()
    management.call_command(u'cms', u'copy', u'site', (u'--from-site=%s' % site_1_pk), (u'--to-site=%s' % site_2_pk), stdout=out)
    for page in Page.objects.on_site(site_1_pk).drafts():
        page.publish(u'en')
    for page in Page.objects.on_site(site_2_pk).drafts():
        page.publish(u'en')
    pages_1 = list(Page.objects.on_site(site_1_pk).drafts())
    pages_2 = list(Page.objects.on_site(site_2_pk).drafts())
    for (index, page) in enumerate(pages_1):
        self.assertEqual(page.get_title(u'en'), pages_2[index].get_title(u'en'))
        self.assertEqual(page.depth, pages_2[index].depth)
    phs_1 = []
    phs_2 = []
    for page in Page.objects.on_site(site_1_pk).drafts():
        phs_1.extend(page.placeholders.values_list(u'pk', flat=True))
    for page in Page.objects.on_site(site_2_pk).drafts():
        phs_2.extend(page.placeholders.values_list(u'pk', flat=True))
    self.assertEqual(CMSPlugin.objects.filter(placeholder__in=phs_1).count(), number_start_plugins)
    self.assertEqual(CMSPlugin.objects.filter(placeholder__in=phs_2).count(), number_start_plugins)
    root_page_1 = Page.objects.on_site(site_1_pk).get_home(site_1_pk)
    root_page_2 = Page.objects.on_site(site_2_pk).get_home(site_2_pk)
    root_plugins_1 = CMSPlugin.objects.filter(placeholder=root_page_1.placeholders.get(slot=u'body'))
    root_plugins_2 = CMSPlugin.objects.filter(placeholder=root_page_2.placeholders.get(slot=u'body'))
    (first_plugin_1, _) = root_plugins_1.get(language=u'en', parent=None).get_plugin_instance()
    (first_plugin_2, _) = root_plugins_2.get(language=u'en', parent=None).get_plugin_instance()
    self.assertEqual(first_plugin_1.plugin_type, first_plugin_2.plugin_type)
    (link_1, _) = root_plugins_1.get(language=u'en', plugin_type=u'LinkPlugin').get_plugin_instance()
    (link_2, _) = root_plugins_2.get(language=u'en', plugin_type=u'LinkPlugin').get_plugin_instance()
    self.assertEqual(link_1.external_link, link_2.external_link)
    self.assertEqual(link_1.get_position_in_placeholder(), link_2.get_position_in_placeholder())
