mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-03-27 13:24:26 +03:00
First pass at rolling the test running into the djangorestframework package
This commit is contained in:
parent
547a98da8c
commit
d6e7e95d95
29
djangorestframework/tests/runtests.py
Normal file
29
djangorestframework/tests/runtests.py
Normal file
|
@ -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()
|
7
djangorestframework/tests/urls.py
Normal file
7
djangorestframework/tests/urls.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
"""
|
||||||
|
Blank URLConf just to keep runtests.py happy.
|
||||||
|
"""
|
||||||
|
from django.conf.urls.defaults import *
|
||||||
|
|
||||||
|
urlpatterns = patterns('',
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user