'Publisher always creates two Page objects for every CMS page,
one is_draft and one is_public.
The public version of the page can be either published or not.
This bit of code uses sometimes manager methods and sometimes manual
filters on purpose (this helps test the managers)'

def test_command_line_publishes_one_page(self):

    get_user_model().objects.create_superuser('djangocms', 'cms@example.com', '123456')
    create_page('The    page!', 'nav_playground.html', 'en', published=True)
    draft = Page.objects.drafts()[0]
    draft.reverse_id = 'a_test'
    draft.save()
    pages_from_output = 0
    published_from_output = 0
    with StdoutOverride() as buffer:
        call_command('cms', 'publisher-publish')
        lines = buffer.getvalue().split('\n')
    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, 1)
    self.assertEqual(published_from_output, 1)
    not_drafts = len(Page.objects.filter(publisher_is_draft=False))
    drafts = len(Page.objects.filter(publisher_is_draft=True))
    self.assertEqual(not_drafts, 1)
    self.assertEqual(drafts, 1)
    non_draft = Page.objects.public()[0]
    self.assertEqual(non_draft.reverse_id, 'a_test')
