[Python-modules-commits] [python-django] 01/01: Add debian/tests/; included in 1.7.11-1, but not in git

Luke Faraone lfaraone at moszumanska.debian.org
Sat Sep 24 22:56:00 UTC 2016


This is an automated email from the git hooks/post-receive script.

lfaraone pushed a commit to branch debian/jessie-updates
in repository python-django.

commit e61715aa51081db398c616e19b6b864dc548f22e
Author: Luke Faraone <lfaraone at debian.org>
Date:   Sat Sep 24 22:55:12 2016 +0000

    Add debian/tests/; included in 1.7.11-1, but not in git
---
 debian/tests/control      |  9 +++++++++
 debian/tests/django-admin | 42 ++++++++++++++++++++++++++++++++++++++++++
 debian/tests/test-suite   | 11 +++++++++++
 3 files changed, 62 insertions(+)

diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..d62e0c1
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,9 @@
+Test-Command: debian/tests/django-admin --with python2
+Depends: python-django
+
+Test-Command: debian/tests/django-admin --with python3
+Depends: python3-django
+
+Test-Command: debian/tests/test-suite python2 python3
+Restrictions: allow-stderr, needs-recommends
+Depends: @, @builddeps@
diff --git a/debian/tests/django-admin b/debian/tests/django-admin
new file mode 100644
index 0000000..e27bda1
--- /dev/null
+++ b/debian/tests/django-admin
@@ -0,0 +1,42 @@
+#!/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 $ADTTMP
+run django-admin startproject testproject
+
+ensure_files_exist testproject/manage.py testproject/testproject/settings.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
+
+# Needed because upstream doesn't want to rewrite shebang of ./manage.py
+# see https://code.djangoproject.com/ticket/20027
+if [ -e /usr/bin/python ]; then
+    ./manage.py check
+else
+    python3 ./manage.py check
+fi
diff --git a/debian/tests/test-suite b/debian/tests/test-suite
new file mode 100644
index 0000000..edc5740
--- /dev/null
+++ b/debian/tests/test-suite
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+cp -a tests $ADTTMP/tests
+cd $ADTTMP/tests
+
+for python in "$@"; do
+    echo "Running “$python ./runtests.py --verbosity 2”"
+    LC_ALL=C.UTF-8 $python ./runtests.py --verbosity 2
+done

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-django.git



More information about the Python-modules-commits mailing list