Commits

Anonymous committed 0f8aff3

Use self.stdout.write instead of print in custom django-admin commands, to avoid clobbering of tests output.

Comments (0)

Files changed (2)

admin_tools/dashboard/management/commands/customdashboard.py

             raise CommandError('file "%s" already exists' % dst)
         context['file'] = os.path.basename(dst).split('.')[0]
         open(dst, 'w').write(render_to_string(tpl, context))
-        print '"%s" written.' % os.path.join(dst)
+        self.stdout.write('"%s" written.' % os.path.join(dst))
 

admin_tools/menu/management/commands/custommenu.py

             'project': project_name,
             'file': os.path.basename(dst).split('.')[0]
         }))
-        print '"%s" written.' % os.path.join(dst)
+        self.stdout.write('"%s" written.' % os.path.join(dst))