'This tests the plugin models patching when publishing from the command line'

def test_table_name_patching(self):

    User = get_user_model()
    User.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()
    add_plugin(draft.placeholders.get(slot=u'body'), u'TextPlugin', u'en', body='Test    content')
    draft.publish('en')
    add_plugin(draft.placeholders.get(slot=u'body'), u'TextPlugin', u'en', body='Test    content')
    Text._meta.db_table = 'djangocms_text_ckeditor_text'
    plugin_pool.patched = False
    with StdoutOverride():
        call_command('cms', 'publisher-publish')
    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)
