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 36 37 38
|
#!/bin/sh
set -e
ensure_files_exist() {
for f in "$@"; do
if [ ! -e $f ]; then
echo "ERROR: $f does not exist" >&2
exit 1
else
echo "OK: $f is there"
fi
done
}
run() {
echo "Running “$@”"
$@
}
# Test startproject
cd $AUTOPKGTEST_TMP
run django-admin startproject testproject
ensure_files_exist testproject/manage.py testproject/testproject/settings.py
grep -qs python3 testproject/manage.py
# Test startapp
cd testproject
run django-admin startapp testapp
ensure_files_exist testapp/models.py testapp/tests.py testapp/views.py
# Test manage.py
#./manage.py check
python3 ./manage.py check
|