diff --git a/web/src/python/README b/web/src/python/README deleted file mode 100644 index dd2611a2..00000000 --- a/web/src/python/README +++ /dev/null @@ -1,8 +0,0 @@ -TODO: should this file go here? - - -Running tests -------------- - -Example: test only the "nimbus" app test: - $ python nimbusweb/portal/manage.py test nimbus --pythonpath="." diff --git a/web/src/python/nimbusweb/portal/settings.py b/web/src/python/nimbusweb/portal/settings.py index 46805575..852aa2db 100644 --- a/web/src/python/nimbusweb/portal/settings.py +++ b/web/src/python/nimbusweb/portal/settings.py @@ -63,7 +63,7 @@ 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', - #'cpserver', + 'cpserver', 'nimbusweb.portal.nimbus', 'nimbusweb.portal.usercreate', ) diff --git a/web/src/python/run-tests.sh b/web/src/python/run-tests.sh new file mode 100755 index 00000000..1f63b296 --- /dev/null +++ b/web/src/python/run-tests.sh @@ -0,0 +1,26 @@ +# Usage: +# +# $ ./run-tests.sh django-app-name-to-test +# +# If you do not specify an app name, all test will run. +# TODO: let '--verbosity' be passed in as an argument. +# +PYTHON_EXE="/usr/bin/env python" + +NIMBUS_WEBDIR_REL="`dirname $0`/../.." +NIMBUS_WEBDIR=`cd $NIMBUS_WEBDIR_REL; pwd` + +NIMBUS_WEBCONF="$NIMBUS_WEBDIR/nimbusweb.conf" +if [ ! -f "$NIMBUS_WEBCONF" ]; then + echo "" + echo "Cannot find conf file, exiting. (expected at '$NIMBUS_WEBCONF')" + exit 1 +fi + +NIMBUS_PYLIB="$NIMBUS_WEBDIR/lib/python" +NIMBUS_PYSRC="$NIMBUS_WEBDIR/src/python" + +PYTHONPATH="$NIMBUS_PYSRC:$NIMBUS_PYLIB:$PYTHONPATH" +export PYTHONPATH + +$PYTHON_EXE $NIMBUS_PYSRC/nimbusweb/portal/manage.py test --verbosity=2 $1