aboutsummaryrefslogtreecommitdiff
path: root/unit-test.sh
blob: f63358776beb5310a5c992dc985581b3a447a95e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh -e

HERE=$(dirname $(readlink -f $0))
cd $HERE

SKIP_LINT="${SKIP_LINT-1}"
VENV_DIR="${VENV_DIR-$HERE/.venv}"

if [ ! -f /usr/bin/virtualenv ] ; then
	echo "installing python-virutalenv"
	sudo apt-get install -f python-virtualenv
fi

if [ -z $VIRTUAL_ENV ] ; then
	echo "creating venv: $VENV_DIR ..."
	virtualenv --python=`which python2` $VENV_DIR
	. $VENV_DIR/bin/activate
	pip install -r requirements.txt
fi

DJANGO_SETTINGS_MODULE=settings SKIP_LINT=$SKIP_LINT ./manage.py test license_protected_downloads