def test_command_line_publish_one_site(self):
        get_user_model().objects.create_superuser('djangocms', 'cms@example.com', '123456')

        siteA = Site.objects.create(domain='a.example.com', name='a.example.com')
        siteB = Site.objects.create(domain='b.example.com', name='b.example.com')

        #example.com
        create_page(u"example.com homepage", "nav_playground.html", "en", published=True)
        #a.example.com
        create_page(u"a.example.com homepage", "nav_playground.html", "de", site=siteA, published=True)
        #b.example.com
        create_page(u"b.example.com homepage", "nav_playground.html", "de", site=siteB, published=True)
        create_page(u"b.example.com about", "nav_playground.html", "nl", site=siteB, published=True)

        with StdoutOverride() as buffer:
            # Now we don't expect it to raise, but we need to redirect IO
            call_command('cms', 'publisher-publish', site=siteB.id)
            lines = buffer.getvalue().split('\n') #NB: readlines() doesn't work

        for line in lines:
            if 'Total' in line:
                pages_from_output = int(line.split(':')[1])
            elif 'Published' in line:
                published_from_output = int(line.split(':')[1])

        self.assertEqual(pages_from_output, 2)
        self.assertEqual(published_from_output, 2)
dataset/ETHPy150Open divio/django-cms/cms/tests/test_publisher.py/PublisherCommandTests.test_command_line_publish_one_site/original