title: Displaying single line progress during Django management command and disabling it during tests
body: <p>I have some Django management commands which call methods in other classes to perform various tasks, like fetching data from external APIs. </p>
  
  <p>In those methods I'm outputting a single line that displays progress, something like:</p>
  
  <pre><code>print('Fetched %d of %d' % (n, total) + ' '*30, end='\r')
  </code></pre>
  
  <p>That works fine, but when I run my tests this gets printed out and screws up the <code>.....E....F...</code> display. I could patch <code>print</code> in all my tests, but that seems clunky.</p>
  
  <p>So (a) should I be outputting that progress line some other way, and/or (b) is there a better way to suppress that output while running tests?</p>