Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 47 lines (39 sloc) 1.394 kb
0b30417 @hannseman initial
hannseman authored
1 #!/usr/bin/env python
2
3 import sys
28bd978 @hannseman Add support for Django 1.7, fixes #4
hannseman authored
4 import django
0b30417 @hannseman initial
hannseman authored
5 from django.conf import settings
6
7
8 def main():
28bd978 @hannseman Add support for Django 1.7, fixes #4
hannseman authored
9 if not settings.configured:
10 # Dynamically configure the Django settings with the minimum necessary to
11 # get Django running tests
12 settings.configure(
13 INSTALLED_APPS=[
14 'django.contrib.auth',
15 'django.contrib.contenttypes',
16 'django.contrib.admin',
17 'django.contrib.sessions',
18 'django_enumfield',
19 'django_enumfield.tests',
20 ],
21 # Django replaces this, but it still wants it. *shrugs*
22 DATABASE_ENGINE='django.db.backends.sqlite3',
23 DATABASES={
24 'default': {
25 'ENGINE': 'django.db.backends.sqlite3',
26 }
27 },
28 MEDIA_ROOT='/tmp/django_enums/',
29 MEDIA_PATH='/media/',
30 ROOT_URLCONF='django_enumfield.tests.urls',
31 DEBUG=True,
32 TEMPLATE_DEBUG=True,
33 )
0b30417 @hannseman initial
hannseman authored
34
28bd978 @hannseman Add support for Django 1.7, fixes #4
hannseman authored
35 # Compatibility with Django 1.7's stricter initialization
36 if hasattr(django, 'setup'):
37 django.setup()
0b30417 @hannseman initial
hannseman authored
38
28bd978 @hannseman Add support for Django 1.7, fixes #4
hannseman authored
39 from django.test.utils import get_runner
0b30417 @hannseman initial
hannseman authored
40 test_runner = get_runner(settings)(verbosity=2, interactive=True)
41 failures = test_runner.run_tests(['django_enumfield'])
42 sys.exit(failures)
43
44
45 if __name__ == '__main__':
46 main()
Something went wrong with that request. Please try again.