| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
ensure_files_exist() { |
| 6 |
for f in "$@"; do |
| 7 |
if [ ! -e $f ]; then |
| 8 |
echo "ERROR: $f does not exist" >&2 |
| 9 |
exit 1 |
| 10 |
else |
| 11 |
echo "OK: $f is there" |
| 12 |
fi |
| 13 |
done |
| 14 |
} |
| 15 |
|
| 16 |
run() { |
| 17 |
echo "Running “$@”" |
| 18 |
$@ |
| 19 |
} |
| 20 |
|
| 21 |
# Test startproject |
| 22 |
cd $AUTOPKGTEST_TMP |
| 23 |
run django-admin startproject testproject |
| 24 |
|
| 25 |
ensure_files_exist testproject/manage.py testproject/testproject/settings.py |
| 26 |
|
| 27 |
grep -qs python3 testproject/manage.py |
| 28 |
|
| 29 |
# Test startapp |
| 30 |
cd testproject |
| 31 |
run django-admin startapp testapp |
| 32 |
|
| 33 |
ensure_files_exist testapp/models.py testapp/tests.py testapp/views.py |
| 34 |
|
| 35 |
# Test manage.py |
| 36 |
#./manage.py check |
| 37 |
|
| 38 |
python3 ./manage.py check |