diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2021-10-03 10:06:41 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2021-10-03 11:22:04 +0300 |
commit | 483b351863737a94b3e5871678dd45b40ba815ae (patch) | |
tree | 183afb79b86bc56fdf8800a45a64417258d188c9 /dev-python/django-js-asset | |
parent | dev-lang/mercury: avoid using cygpath references when building GC (diff) | |
download | gentoo-483b351863737a94b3e5871678dd45b40ba815ae.tar.gz gentoo-483b351863737a94b3e5871678dd45b40ba815ae.tar.bz2 gentoo-483b351863737a94b3e5871678dd45b40ba815ae.zip |
dev-python/django-js-asset: enable py3.10, cleanup tests
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'dev-python/django-js-asset')
-rw-r--r-- | dev-python/django-js-asset/Manifest | 2 | ||||
-rw-r--r-- | dev-python/django-js-asset/django-js-asset-1.2.2.ebuild | 23 | ||||
-rw-r--r-- | dev-python/django-js-asset/files/django-js-asset-1.2.2-fix-django3.patch | 55 |
3 files changed, 73 insertions, 7 deletions
diff --git a/dev-python/django-js-asset/Manifest b/dev-python/django-js-asset/Manifest index 75fad6dc7072..6a029054963b 100644 --- a/dev-python/django-js-asset/Manifest +++ b/dev-python/django-js-asset/Manifest @@ -1 +1 @@ -DIST django-js-asset-1.2.2.tar.gz 4436 BLAKE2B e6b2ff1b2b90da5ae95af08b28eb1970e6e0edffee7eeec0a4697855040c4afd0febcc569d0a78c46bca80835b404367c426019016e5089b3aed984916e13cc2 SHA512 ea050c5093abd8312733b1402e275fcb44f0702c27e28aeb64d0470a8514cd85906707915556a9878b669c96918813c4bf2b69d281d33f18fcc7c143f8ae9f48 +DIST django-js-asset-1.2.2.gh.tar.gz 6367 BLAKE2B 5b24d3a2cf1ca2b28b82e581541dcb58aa2bf25d99f865007730c00211452dc5a062dc014b47fd1d10020d2a0b8f74060910460dec4f95be2b83c5c6d7bfb4d2 SHA512 ad2c51399da9b5d75305c0fa257cc75496df3f6704a827a0d297a4d762712039c3ebd921afbe6e10672626f1badd8637728292dd700ba41c4192c95ec73095a9 diff --git a/dev-python/django-js-asset/django-js-asset-1.2.2.ebuild b/dev-python/django-js-asset/django-js-asset-1.2.2.ebuild index 16175edec804..5704b6a31f05 100644 --- a/dev-python/django-js-asset/django-js-asset-1.2.2.ebuild +++ b/dev-python/django-js-asset/django-js-asset-1.2.2.ebuild @@ -3,20 +3,31 @@ EAPI=7 -PYTHON_COMPAT=( python3_{7..9} ) +PYTHON_COMPAT=( python3_{8..10} ) inherit distutils-r1 DESCRIPTION="script tag with additional attributes for django.forms.Media" HOMEPAGE="https://github.com/matthiask/django-js-asset" -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" +SRC_URI=" + https://github.com/matthiask/django-js-asset/archive/${PV}.tar.gz + -> ${P}.gh.tar.gz +" LICENSE="BSD" SLOT="0" KEYWORDS="~amd64" -RESTRICT="test" +IUSE="test" +RESTRICT="!test? ( test )" RDEPEND=">=dev-python/django-1.17[${PYTHON_USEDEP}]" -DEPEND="${RDEPEND}" -BDEPEND="test? ( dev-python/coverage[${PYTHON_USEDEP}] )" +BDEPEND="test? ( ${RDEPEND} )" -distutils_enable_tests setup.py +PATCHES=( + "${FILESDIR}/${P}-fix-django3.patch" +) + +python_test() { + cd tests || die + local -x DJANGO_SETTINGS_MODULE=testapp.settings + django-admin test -v 2 || die +} diff --git a/dev-python/django-js-asset/files/django-js-asset-1.2.2-fix-django3.patch b/dev-python/django-js-asset/files/django-js-asset-1.2.2-fix-django3.patch new file mode 100644 index 000000000000..4ab0484b17e0 --- /dev/null +++ b/dev-python/django-js-asset/files/django-js-asset-1.2.2-fix-django3.patch @@ -0,0 +1,55 @@ +From 232536ba50a2e1a0cffc6046dbcdfdec22cb0d9e Mon Sep 17 00:00:00 2001 +From: Matthias Kestenholz <mk@feinheit.ch> +Date: Fri, 15 May 2020 08:51:33 +0200 +Subject: [PATCH] Adapt the test suite to changes in Django + +--- a/tests/testapp/test_js_asset.py ++++ b/tests/testapp/test_js_asset.py +@@ -1,11 +1,15 @@ + from __future__ import unicode_literals + ++import django + from django.forms import Media + from django.test import TestCase + + from js_asset.js import JS + + ++JS_TYPE = ' type="text/javascript"' if django.VERSION < (3, 1) else "" ++ ++ + class AssetTest(TestCase): + def test_asset(self): + media = Media( +@@ -25,15 +29,17 @@ def test_asset(self): + html, + ) + self.assertInHTML( +- '<script type="text/javascript" src="/static/app/test.js"></script>', # noqa ++ '<script{} src="/static/app/test.js"></script>'.format(JS_TYPE), # noqa + html, + ) + self.assertInHTML( +- '<script type="text/javascript" src="/static/app/asset.js" data-the-answer="42" id="asset-script"></script>', # noqa ++ '<script{} src="/static/app/asset.js" data-the-answer="42" id="asset-script"></script>'.format( # noqa ++ JS_TYPE ++ ), + html, + ) + self.assertInHTML( +- '<script type="text/javascript" src="/static/app/asset-without.js"></script>', # noqa ++ '<script{} src="/static/app/asset-without.js"></script>'.format(JS_TYPE), + html, + ) + +@@ -42,7 +48,9 @@ def test_absolute(self): + html = "%s" % media + + self.assertInHTML( +- '<script type="text/javascript" src="https://cdn.example.org/script.js"></script>', # noqa ++ '<script{} src="https://cdn.example.org/script.js"></script>'.format( ++ JS_TYPE ++ ), + html, + ) + |