diff options
| author | tom christie tom@tomchristie.com | 2011-03-10 08:58:34 +0000 |
|---|---|---|
| committer | tom christie tom@tomchristie.com | 2011-03-10 08:58:34 +0000 |
| commit | d6e7e95d95e7367f0d999c14d874d810a028a177 (patch) | |
| tree | 222ea78e9df9415bd220aa0a357a5cf8dc3aaf60 | |
| parent | 547a98da8cce9efb548089b33b9879026586c36c (diff) | |
| download | django-rest-framework-d6e7e95d95e7367f0d999c14d874d810a028a177.tar.bz2 | |
First pass at rolling the test running into the djangorestframework package
| -rw-r--r-- | djangorestframework/tests/runtests.py | 29 | ||||
| -rw-r--r-- | djangorestframework/tests/urls.py | 7 |
2 files changed, 36 insertions, 0 deletions
diff --git a/djangorestframework/tests/runtests.py b/djangorestframework/tests/runtests.py new file mode 100644 index 00000000..3043c7b6 --- /dev/null +++ b/djangorestframework/tests/runtests.py @@ -0,0 +1,29 @@ +''' +Created on Mar 10, 2011 + +@author: tomchristie +''' +# http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/ +# http://www.travisswicegood.com/2010/01/17/django-virtualenv-pip-and-fabric/ +from django.conf import settings +from django.core.management import call_command + +def runtests(): + settings.configure( + INSTALLED_APPS=( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.messages', + 'djangorestframework', + ), + ROOT_URLCONF='djangorestframework.tests.urls', + # Django replaces this, but it still wants it. *shrugs* + DATABASE_ENGINE='sqlite3' + ) + call_command('test', 'djangorestframework') + + +if __name__ == '__main__': + runtests() diff --git a/djangorestframework/tests/urls.py b/djangorestframework/tests/urls.py new file mode 100644 index 00000000..45555813 --- /dev/null +++ b/djangorestframework/tests/urls.py @@ -0,0 +1,7 @@ +""" +Blank URLConf just to keep runtests.py happy. +""" +from django.conf.urls.defaults import * + +urlpatterns = patterns('', +)
\ No newline at end of file |
