diff options
author | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2010-01-03 01:25:40 +0000 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2010-01-03 01:25:40 +0000 |
commit | c9af27ab3169a867797f750e46e1df7537650b88 (patch) | |
tree | ef95ae7c4675c2e82ba0924c5695cf05b04edc71 /dev-python | |
parent | Version bump (diff) | |
download | gentoo-2-c9af27ab3169a867797f750e46e1df7537650b88.tar.gz gentoo-2-c9af27ab3169a867797f750e46e1df7537650b88.tar.bz2 gentoo-2-c9af27ab3169a867797f750e46e1df7537650b88.zip |
Fix tests (bug #294575).
(Portage version: 15156-svn/cvs/Linux x86_64)
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/django/ChangeLog | 8 | ||||
-rw-r--r-- | dev-python/django/django-1.1.1.ebuild | 41 | ||||
-rw-r--r-- | dev-python/django/files/django-1.1.1-fix_tests.patch | 25 |
3 files changed, 55 insertions, 19 deletions
diff --git a/dev-python/django/ChangeLog b/dev-python/django/ChangeLog index bc9817c30827..3e05ca79e9a1 100644 --- a/dev-python/django/ChangeLog +++ b/dev-python/django/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-python/django -# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/django/ChangeLog,v 1.39 2009/10/10 15:29:36 grobian Exp $ +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/django/ChangeLog,v 1.40 2010/01/03 01:25:39 arfrever Exp $ + + 03 Jan 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> + django-1.1.1.ebuild, +files/django-1.1.1-fix_tests.patch: + Fix tests (bug #294575). 10 Oct 2009; Fabian Groffen <grobian@gentoo.org> django-1.1.1.ebuild: Merge from Prefix diff --git a/dev-python/django/django-1.1.1.ebuild b/dev-python/django/django-1.1.1.ebuild index 78205290e5e8..07e5ba756c22 100644 --- a/dev-python/django/django-1.1.1.ebuild +++ b/dev-python/django/django-1.1.1.ebuild @@ -1,17 +1,18 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/django/django-1.1.1.ebuild,v 1.2 2009/10/10 15:29:36 grobian Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/django/django-1.1.1.ebuild,v 1.3 2010/01/03 01:25:39 arfrever Exp $ EAPI="2" SUPPORT_PYTHON_ABIS="1" inherit bash-completion distutils multilib versionator webapp -MY_P="${P/#d/D}" +MY_PN="Django" +MY_P="${MY_PN}-${PV}" WEBAPP_MANUAL_SLOT="yes" DESCRIPTION="High-level python web framework" -HOMEPAGE="http://www.djangoproject.com/" +HOMEPAGE="http://www.djangoproject.com/ http://pypi.python.org/pypi/Django" SRC_URI="http://media.djangoproject.com/releases/${PV}/${MY_P}.tar.gz" LICENSE="BSD" @@ -32,8 +33,7 @@ DEPEND="${RDEPEND} >=dev-lang/python-2.5[sqlite] ( dev-python/pysqlite:2 <dev-lang/python-2.5 ) ) )" - -RESTRICT_PYTHON_ABIS="3*" +RESTRICT_PYTHON_ABIS="3.*" S="${WORKDIR}/${MY_P}" @@ -41,10 +41,15 @@ PYTHON_MODNAME="django" DOCS="docs/* AUTHORS" +src_prepare() { + distutils_src_prepare + epatch "${FILESDIR}/${P}-fix_tests.patch" +} + src_compile() { distutils_src_compile - if use doc ; then + if use doc; then pushd docs > /dev/null emake html || die "Generation of HTML documentation failed" popd > /dev/null @@ -59,36 +64,38 @@ DATABASE_NAME='test.db' ROOT_URLCONF='tests/urls.py' SITE_ID=1 __EOF__ - PYTHONPATH="build-${PYTHON_ABI}/lib" "$(PYTHON)" tests/runtests.py --settings=settings -v1 + # Tests have non-standard assumptions about PYTHONPATH and + # don't work with usual "build-${PYTHON_ABI}/lib". + PYTHONPATH="." "$(PYTHON)" tests/runtests.py --settings=settings -v1 } python_execute_function testing } src_install() { - [[ -z ${ED} ]] && local ED=${D} - distutils_python_version - site_pkgs="$(python_get_sitedir)" - export PYTHONPATH="${PYTHONPATH}:${ED}/${site_pkgs}" - dodir ${site_pkgs} + [[ -z "${ED}" ]] && local ED="${D}" + + python_set_active_version 2 + local sitedir="$(python_get_sitedir)" + export PYTHONPATH="${PYTHONPATH}${PYTHONPATH:+:}${ED}/${sitedir}" + dodir "${sitedir}" distutils_src_install dobashcompletion extras/django_bash_completion - if use examples ; then + if use examples; then insinto /usr/share/doc/${PF} doins -r examples fi - if use doc ; then + if use doc; then mv docs/_build/html/{_,.}sources dohtml txt -r docs/_build/html/* fi insinto "${MY_HTDOCSDIR#${EPREFIX}}" - doins -r "${ED}/${site_pkgs}"/django/contrib/admin/media/* + doins -r "${ED}/${sitedir}/django/contrib/admin/media/"* || die "doins failed" - #webapp_postinst_txt en "${WORKDIR}"/postinstall-en.txt webapp_src_install } diff --git a/dev-python/django/files/django-1.1.1-fix_tests.patch b/dev-python/django/files/django-1.1.1-fix_tests.patch new file mode 100644 index 000000000000..cc3c1093fe32 --- /dev/null +++ b/dev-python/django/files/django-1.1.1-fix_tests.patch @@ -0,0 +1,25 @@ +http://code.djangoproject.com/changeset/11619 +http://code.djangoproject.com/changeset/11697 + +--- django/template/defaultfilters.py ++++ django/template/defaultfilters.py +@@ -162,7 +162,7 @@ + + try: + m = int(d) - d +- except (OverflowError, InvalidOperation): ++ except (ValueError, OverflowError, InvalidOperation): + return input_val + + if not m and p < 0: +--- tests/regressiontests/views/tests/generic/date_based.py ++++ tests/regressiontests/views/tests/generic/date_based.py +@@ -100,7 +100,7 @@ + + now = datetime.now() + prev_month = now.date().replace(day=1) +- if prev_month.month == 11: ++ if prev_month.month == 1: + prev_month = prev_month.replace(year=prev_month.year-1, month=12) + else: + prev_month = prev_month.replace(month=prev_month.month-1) |