Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

make tests work with setup.py test and move test in one location

  • Loading branch information...
commit 8b0850e924357a997be13391f13b27aa03a20330 1 parent 529a487
trbs trbs authored
1  django_extensions/tests/__init__.py
... ... @@ -1,5 +1,6 @@
1 1 from django.db import models
2 2 from django_extensions.tests.test_dumpscript import DumpScriptTests
  3 +from django_extensions.tests.test_print_settings import PrintSettingsTests
3 4 from django_extensions.tests.utils import UTILS_TRUNCATE_LETTERS_TESTS
4 5 from django_extensions.tests.utils import UTILS_UUID_TESTS
5 6 from django_extensions.tests.json_field import JsonFieldTest
2  tests/test_print_settings.py → django_extensions/tests/test_print_settings.py
@@ -5,7 +5,7 @@
5 5
6 6 import subprocess
7 7 import sys
8   -import unittest2 as unittest
  8 +from django.utils import unittest
9 9
10 10
11 11 class PrintSettingsTests(unittest.TestCase):
11 run_tests.py 100644 → 100755
... ... @@ -1,6 +1,5 @@
1 1
2   -# from http://www.travisswicegood.com/2010/01/17/django-virtualenv-pip-and-fabric/
3   -
  2 +import sys
4 3 from django.conf import settings
5 4 from django.core.management import call_command
6 5
@@ -8,7 +7,7 @@ def main():
8 7 # Dynamically configure the Django settings with the minimum necessary to
9 8 # get Django running tests
10 9 settings.configure(
11   - INSTALLED_APPS=[
  10 + INSTALLED_APPS = [
12 11 'django.contrib.auth',
13 12 'django.contrib.contenttypes',
14 13 'django.contrib.admin',
@@ -30,8 +29,10 @@ def main():
30 29 TEMPLATE_DEBUG = True
31 30 )
32 31
33   - # Fire off the tests
34   - call_command('test', 'django_extensions')
  32 + from django.test.utils import get_runner
  33 + test_runner = get_runner(settings)(verbosity=2, interactive=True)
  34 + failures = test_runner.run_tests(['django_extensions'])
  35 + sys.exit(failures)
35 36
36 37
37 38 if __name__ == '__main__':
4 setup.py
@@ -87,8 +87,8 @@ def fullsplit(path, result=None):
87 87 packages=packages,
88 88 cmdclass=cmdclasses,
89 89 data_files=data_files,
90   - tests_require=['Django', 'unittest2'],
91   - test_suite='unittest2.collector',
  90 + tests_require=['Django'],
  91 + test_suite='run_tests.main',
92 92 classifiers=[
93 93 'Development Status :: 4 - Beta',
94 94 'Development Status :: 5 - Production/Stable',
0  tests/__init__.py
No changes.

0 comments on commit 8b0850e

Please sign in to comment.
Something went wrong with that request. Please try again.