forked from jamesturk/django-markupfield
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tests.sh
executable file
·35 lines (27 loc) · 1008 Bytes
/
run_tests.sh
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
30
31
32
33
34
35
#!/bin/bash
args="--settings=markupfield.tests.settings --pythonpath=."
error=false
if `python -c 'import django; exit(0 if django.VERSION >= (1, 7) else 1)'` || false; then
# testing for bug #20
# removing old, pyc files. Python will overwrite them if the file is updated but
# python won't remove them when a file has been removed. These old files can then
# be still imported, which often ends up in an error when testing migration.
find .. -name "*.pyc" -type f | xargs rm
rm -rf migrations markuptest.db
echo "> Testing migration..."
django-admin.py makemigrations tests $args || error=true
django-admin.py migrate $args || error=true
echo "> Unit testing"
django-admin.py test $args || error=true
echo "> Cleaning up..."
rm -r markupfield/tests/migrations
rm markuptest.db
else
django-admin.py test $args
fi
if $error; then
exit 1
else
exit 0
fi
# django-admin.py test --settings=markupfield.tests.settings --pythonpath=../..