diff --git a/debian/changelog b/debian/changelog
index 66f23178cbc4f0cf3ee0b6a6f51125db7d46b172..a385796fe0468c65a822bef91795437bbc596ab8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,9 @@
-python-defaults (2.7.2-9) UNRELEASED; urgency=low
+python-defaults (2.7.2-9) unstable; urgency=low
 
   * Generate correct dependencies if private directory supports one Python
     version only (closes: #644573)
 
- -- Piotr Ożarowski <piotr@debian.org>  Sat, 08 Oct 2011 14:18:31 +0200
+ -- Piotr Ożarowski <piotr@debian.org>  Sat, 08 Oct 2011 17:16:46 +0200
 
 python-defaults (2.7.2-8) unstable; urgency=high
 
diff --git a/tests/Makefile b/tests/Makefile
index 563a4b77ae9193b2d307a5258a5c449bba9c1763..8cade20bd5cc5162d750559696ba4405930ad468 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,7 +1,7 @@
 #!/usr/bin/make -f
 
 # enable or disable tests here:
-TESTS := test1 test2 test3 test4 test5
+TESTS := test1 test2 test3 test4 test5 test6
 
 all: $(TESTS)
 
diff --git a/tests/t6/Makefile b/tests/t6/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..b8f141e9b6eb43282493697d3ba5bea13c961b24
--- /dev/null
+++ b/tests/t6/Makefile
@@ -0,0 +1,24 @@
+#!/usr/bin/make -f
+
+all: run check
+
+
+run: clean
+	dpkg-buildpackage -b -us -uc
+
+check:
+	# python2.4 hardcoded via `dh_python2 -V 2.4`
+	grep -q Depends:.*python2.4 debian/foo/DEBIAN/control
+	grep -q '\-V 2.4 /usr/share/baz24' debian/foo/usr/share/python/runtime.d/foo.rtupdate
+	grep -q '/usr/share/baz24 \-V 2.4' debian/foo/DEBIAN/postinst
+	# python2.5 due to X-Python-Version: 2.5
+	grep -q Depends:.*python2.5 debian/foo/DEBIAN/control
+	grep -q '\-V 2.5 /usr/share/bar25' debian/foo/usr/share/python/runtime.d/foo.rtupdate
+	grep -q '/usr/share/bar25 \-V 2.5' debian/foo/DEBIAN/postinst
+	# python2.6 hardcoded via shebang
+	grep -q Depends:.*python2.6 debian/foo/DEBIAN/control
+	grep -q '\-V 2.6 /usr/share/foo' debian/foo/usr/share/python/runtime.d/foo.rtupdate
+	grep -q '/usr/share/foo \-V 2.6' debian/foo/DEBIAN/postinst
+
+clean:
+	./debian/rules clean
diff --git a/tests/t6/bar.py b/tests/t6/bar.py
new file mode 100755
index 0000000000000000000000000000000000000000..f1d7b7c3ea364e6c7dcb7d9729a44f7b653d49f5
--- /dev/null
+++ b/tests/t6/bar.py
@@ -0,0 +1,2 @@
+#!/usr/bin/python
+print("I'm bar")
diff --git a/tests/t6/baz.py b/tests/t6/baz.py
new file mode 100644
index 0000000000000000000000000000000000000000..aced459fa8549609f723752b4604e12298b4d835
--- /dev/null
+++ b/tests/t6/baz.py
@@ -0,0 +1,2 @@
+#!/usr/bin/python
+print("I'm baz")
diff --git a/tests/t6/debian/changelog b/tests/t6/debian/changelog
new file mode 100644
index 0000000000000000000000000000000000000000..33f04f8f5b9c7f88b523d0e33e096439cb82d432
--- /dev/null
+++ b/tests/t6/debian/changelog
@@ -0,0 +1,5 @@
+foo (0.1.1) unstable; urgency=low
+
+  * Initial release
+
+ -- Piotr Ożarowski <piotr@debian.org>  Sat, 08 Oct 2011 17:13:03 +0200
diff --git a/tests/t6/debian/compat b/tests/t6/debian/compat
new file mode 100644
index 0000000000000000000000000000000000000000..45a4fb75db864000d01701c0f7a51864bd4daabf
--- /dev/null
+++ b/tests/t6/debian/compat
@@ -0,0 +1 @@
+8
diff --git a/tests/t6/debian/control b/tests/t6/debian/control
new file mode 100644
index 0000000000000000000000000000000000000000..2487e0915bc675dabdcabe0cee500c62a67ba1e1
--- /dev/null
+++ b/tests/t6/debian/control
@@ -0,0 +1,20 @@
+Source: foo
+Section: misc
+Priority: optional
+Maintainer: Piotr Ożarowski <piotr@debian.org>
+Build-Depends: debhelper (>= 7.0.50~)
+Build-Depends-Indep: python
+Standards-Version: 3.9.1
+X-Python-Version: 2.5
+
+Package: foo
+Architecture: all
+Depends: ${python:Depends}, ${misc:Depends}
+Recommends: ${python:Recommends}
+Suggests: ${python:Suggests}
+Enhances: ${python:Enhances}
+Description: example 6 - private directory with hardcoded Python version
+ exemple package #6 - private directories that support:
+  * python2.4 hardcoded via `dh_python2 -V 2.4`
+  * python2.5 due to X-Python-Version: 2.5
+  * python2.6 hardcoded via shebang
diff --git a/tests/t6/debian/copyright b/tests/t6/debian/copyright
new file mode 100644
index 0000000000000000000000000000000000000000..69cea758e6ab12db36e1b482bbe3c0b15ba79d83
--- /dev/null
+++ b/tests/t6/debian/copyright
@@ -0,0 +1,2 @@
+The Debian packaging is © 2011, Piotr Ożarowski <piotr@debian.org> and
+is licensed under the MIT License.
diff --git a/tests/t6/debian/install b/tests/t6/debian/install
new file mode 100644
index 0000000000000000000000000000000000000000..12d2c11fe591adc58c1176668c7089d006f651a7
--- /dev/null
+++ b/tests/t6/debian/install
@@ -0,0 +1,6 @@
+foo.py /usr/share/foo/
+spam.py /usr/share/foo/
+bar.py /usr/share/bar25/
+spam.py /usr/share/bar25/
+baz.py /usr/share/baz24/
+spam.py /usr/share/baz24/
diff --git a/tests/t6/debian/rules b/tests/t6/debian/rules
new file mode 100755
index 0000000000000000000000000000000000000000..c08a39034d064c80bf1b1932871b9b9dcb487e07
--- /dev/null
+++ b/tests/t6/debian/rules
@@ -0,0 +1,11 @@
+#!/usr/bin/make -f
+%:
+	dh $@ --buildsystem=python_distutils
+
+override_dh_pysupport:
+	DH_VERBOSE=1 ../../dh_python2
+	DH_VERBOSE=1 ../../dh_python2 /usr/share/bar25
+	DH_VERBOSE=1 ../../dh_python2 /usr/share/baz24 -V 2.4
+
+clean:
+	dh_clean
diff --git a/tests/t6/debian/source/format b/tests/t6/debian/source/format
new file mode 100644
index 0000000000000000000000000000000000000000..89ae9db8f88b823b6a7eabf55e203658739da122
--- /dev/null
+++ b/tests/t6/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/tests/t6/foo.py b/tests/t6/foo.py
new file mode 100755
index 0000000000000000000000000000000000000000..d679d96790fe7a23e101e4afb7a7ad1f0efa7c1a
--- /dev/null
+++ b/tests/t6/foo.py
@@ -0,0 +1,2 @@
+#!/usr/bin/python2.6
+print("I'm foo")
diff --git a/tests/t6/setup.py b/tests/t6/setup.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/tests/t6/spam.py b/tests/t6/spam.py
new file mode 100644
index 0000000000000000000000000000000000000000..c8b0fd913f2eac9af0d025fc8dcffb2cb1429ef9
--- /dev/null
+++ b/tests/t6/spam.py
@@ -0,0 +1 @@
+print('spam')