1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!/bin/bash
# It is expected at this point that django and applicationinsights are both installed into a
# virtualenv.
django_version=$(python -c "import django ; print('.'.join(map(str, django.VERSION[0:2])))")
test $? -eq 0 || exit 1
# Create a new temporary work directory
TMPDIR=$(mktemp -d)
SRCDIR=$(pwd)
function cleanup
{
cd $SRCDIR
rm -rf $TMPDIR
exit $1
}
trap cleanup EXIT SIGINT
cd $TMPDIR
# Set up Django project
django-admin startproject aitest
cd aitest
cp $SRCDIR/views.py aitest/views.py
cp $SRCDIR/tests.py aitest/tests.py
cp $SRCDIR/urls.py aitest/urls.py
cp $SRCDIR/template.html aitest/template.html
./manage.py test
exit $?
|