'Check that copy of languages on one site does not interfere with other
sites'

def test_copy_site_safe(self):

    site_other = 1
    site_active = 2
    origina_site1_langs = {}
    number_start_plugins = CMSPlugin.objects.all().count()
    site_obj = Site.objects.create(domain=u'sample2.com', name=u'sample2.com', pk=site_active)
    for page in Page.objects.on_site(1).drafts():
        origina_site1_langs[page.pk] = set(page.get_languages())
    p1 = create_page(u'page1', published=True, in_navigation=True, language=u'de', template=u'nav_playground.html', site=site_obj)
    create_page(u'page4', published=True, in_navigation=True, language=u'de', template=u'nav_playground.html', site=site_obj)
    create_page(u'page2', published=True, in_navigation=True, parent=p1, language=u'de', template=u'nav_playground.html', site=site_obj)
    for page in Page.objects.on_site(site_active).drafts():
        self._fill_page_body(page, u'de')
    number_site2_plugins = (CMSPlugin.objects.all().count() - number_start_plugins)
    out = StringIO()
    management.call_command(u'cms', u'copy', u'lang', u'--from-lang=de', u'--to-lang=fr', (u'--site=%s' % site_active), interactive=False, stdout=out)
    for page in Page.objects.on_site(site_other).drafts():
        self.assertEqual(origina_site1_langs[page.pk], set(page.get_languages()))
    for page in Page.objects.on_site(site_active).drafts():
        self.assertEqual(set((u'de', u'fr')), set(page.get_languages()))
    self.assertEqual(CMSPlugin.objects.filter(language=u'en').count(), number_start_plugins)
    self.assertEqual(CMSPlugin.objects.filter(language=u'de').count(), number_site2_plugins)
    self.assertEqual(CMSPlugin.objects.filter(language=u'fr').count(), number_site2_plugins)
    self.assertEqual(CMSPlugin.objects.all().count(), (number_start_plugins + (number_site2_plugins * 2)))
