title: Detect django testing mode
body: <p>I'm writing a reusable django app and I need to ensure that its models are only sync'ed when the app is in test mode. I've tried to use a custom DjangoTestRunner, but I found no examples of how to do that (the documentation only shows how to define a custom test runner).</p>
  
  <p>So, does anybody have an idea of how to do it?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here's how I'm doing it:</p>
  
  <pre><code>#in settings.py
  import sys
  TEST = 'test' in sys.argv
  </code></pre>
  
  <p>Hope it helps.</p>