Skip to content

Commit

Permalink
Merge 26820d7 into 31d1295
Browse files Browse the repository at this point in the history
  • Loading branch information
vytisb committed Aug 20, 2019
2 parents 31d1295 + 26820d7 commit 5d0aa6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cms/management/commands/subcommands/list.py
Expand Up @@ -86,9 +86,10 @@ class ListPluginsCommand(SubcommandsCommand):
command_name = 'plugins'

def handle(self, *args, **options):
report = plugin_report()
self.stdout.write('==== Plugin report ==== \n\n')
self.stdout.write('There are %s plugin types in your database \n' % len(plugin_report()))
for plugin in plugin_report():
self.stdout.write('There are %s plugin types in your database \n' % len(report))
for plugin in report:
self.stdout.write('\n%s \n' % plugin['type'])

plugin_model = plugin['model']
Expand Down
6 changes: 5 additions & 1 deletion cms/tests/test_management.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import uuid
import mock
from cms.test_utils.project.sampleapp.cms_apps import SampleApp
from cms.test_utils.util.context_managers import apphooks

Expand Down Expand Up @@ -149,7 +150,10 @@ def test_list_plugins(self):
bogus_plugin = CMSPlugin(language="en", plugin_type="BogusPlugin")
bogus_plugin.save()

management.call_command('cms', 'list', 'plugins', interactive=False, stdout=out)
with mock.patch('cms.management.commands.subcommands.list.plugin_report') as report_fn:
management.call_command('cms', 'list', 'plugins', interactive=False, stdout=out)
report_fn.assert_called_once()

report = plugin_report()

# there should be reports for three plugin types
Expand Down

0 comments on commit 5d0aa6e

Please sign in to comment.