dev-python/django-tastypie: Enable tests
authorMichał Górny <mgorny@gentoo.org>
Sat, 21 Apr 2018 07:49:24 +0000 (09:49 +0200)
committerMichał Górny <mgorny@gentoo.org>
Sat, 21 Apr 2018 07:53:04 +0000 (09:53 +0200)
Enable running tests.  Correct test dependencies.  Replace the silly
test->bip REQUIRED_USE constraint with explicit test dependency
on dev-python/biplist.  Add a blocker on sci-libs/geos.

dev-python/django-tastypie/django-tastypie-0.13.3.ebuild

index eacdb8aacc9265b3d1a4883d2410bd72b46c762d..4ffc18c6c9466bacbff026226e755a3febee0d0b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=5
@@ -26,27 +26,55 @@ COMMON_DEPEND=">=dev-python/mimeparse-0.1.4[${PYTHON_USEDEP}]
 RDEPEND="${COMMON_DEPEND}
                bip? ( dev-python/biplist[${PYTHON_USEDEP}] )"
 
-#dev-python/pyyaml is pulled in with django itself
+# test: django fails at current version of sci-libs/geos, making tests
+# explode immediately
 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
        test? ( ${COMMON_DEPEND}
+               dev-python/biplist[${PYTHON_USEDEP}]
                dev-python/lxml[${PYTHON_USEDEP}]
-               dev-python/coverage[${PYTHON_USEDEP}]
                dev-python/pyyaml[${PYTHON_USEDEP}]
                dev-python/defusedxml[${PYTHON_USEDEP}]
                $(python_gen_cond_dep '>=dev-python/mock-1.1.0[${PYTHON_USEDEP}]' python2_7)
-               >=dev-python/pytz-2013b[${PYTHON_USEDEP}] )
+               >=dev-python/pytz-2013b[${PYTHON_USEDEP}]
+               !!sci-libs/geos[python] )
        doc? ( dev-python/sphinx[${PYTHON_USEDEP}]
                >=dev-python/django-1.9[${PYTHON_USEDEP}]
                <dev-python/django-1.10[${PYTHON_USEDEP}]
                $(python_gen_cond_dep '>=dev-python/mock-1.1.0[${PYTHON_USEDEP}]' python2_7)
                dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}] )"
 
-REQUIRED_USE="test? ( bip )"
-
 python_compile_all() {
        use doc && emake -C docs html
 }
 
+python_test() {
+       cd tests || die
+       # keep in sync with tox.ini
+       django-admin.py test -v 2 -p '*' core.tests --settings=settings_core ||
+               die "core.tests fail with ${EPYTHON}"
+       django-admin.py test -v 2 basic.tests --settings=settings_basic ||
+               die "basic.tests fail with ${EPYTHON}"
+       django-admin.py test -v 2 related_resource.tests --settings=settings_related ||
+               die "related_resource.tests fail with ${EPYTHON}"
+       django-admin.py test -v 2 alphanumeric.tests --settings=settings_alphanumeric ||
+               die "alphanumeric.tests fail with ${EPYTHON}"
+       django-admin.py test -v 2 authorization.tests --settings=settings_authorization ||
+               die "authorization.tests fail with ${EPYTHON}"
+       django-admin.py test -v 2 content_gfk.tests --settings=settings_content_gfk ||
+               die "content_gfk.tests fail with ${EPYTHON}"
+       django-admin.py test -v 2 customuser.tests --settings=settings_customuser ||
+               die "customuser.tests fail with ${EPYTHON}"
+       django-admin.py test -v 2 namespaced.tests --settings=settings_namespaced ||
+               die "namespaced.tests fail with ${EPYTHON}"
+       django-admin.py test -v 2 slashless.tests --settings=settings_slashless ||
+               die "slashless.tests fail with ${EPYTHON}"
+       django-admin.py test -v 2 validation.tests --settings=settings_validation ||
+               die "validation.tests fail with ${EPYTHON}"
+#              requires dev-python/geos but django fails at the current version of it
+#      django-admin.py test -v 2 gis.tests --settings=settings_gis_spatialite ||
+#              die "gis.tests fail with ${EPYTHON}"
+}
+
 python_install_all() {
        use doc && local HTML_DOCS=( docs/_build/html/. )
        distutils-r1_python_install_all