old_contents: # -*- coding: utf-8 -*-
  from __future__ import unicode_literals
  
  import os
  import sys
  
  import django
  
  
  django.setup()
  os.environ['PYTHONPATH'] = os.path.dirname(__file__)
  os.environ['DJANGO_SETTINGS_MODULE'] = 'test_project.settings'
  
  
  def runtests():
      from django.conf import settings
      from django.test.utils import get_runner
      test_runner = get_runner(settings)()
      failures = test_runner.run_tests(['debreach'])
      sys.exit(failures)
  
  
  if __name__ == '__main__':
      runtests()
  
new_contents: # -*- coding: utf-8 -*-
  from __future__ import unicode_literals
  
  import os
  import sys
  
  import django
  
  
  os.environ['PYTHONPATH'] = os.path.dirname(__file__)
  os.environ['DJANGO_SETTINGS_MODULE'] = 'test_project.settings'
  
  
  def runtests():
      if django.VERSION >= (1, 7):
          django.setup()
      from django.conf import settings
      from django.test.utils import get_runner
      test_runner = get_runner(settings)()
      failures = test_runner.run_tests(['debreach'])
      sys.exit(failures)
  
  
  if __name__ == '__main__':
      runtests()
  
subject: call django.setup() only for 1.7