Hello community,
here is the log from the commit of package python-django-js-asset for
openSUSE:Factory checked in at 2020-09-12 00:12:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django-js-asset (Old)
and /work/SRC/openSUSE:Factory/.python-django-js-asset.new.4249 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-js-asset"
Sat Sep 12 00:12:33 2020 rev:2 rq:833792 version:1.2.2
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-django-js-asset/python-django-js-asset.changes
2019-06-19 20:58:52.318006433 +0200
+++
/work/SRC/openSUSE:Factory/.python-django-js-asset.new.4249/python-django-js-asset.changes
2020-09-12 00:13:15.865257307 +0200
@@ -1,0 +2,5 @@
+Fri Sep 11 13:42:52 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- Add upstream patch changes-in-Django.patch to fix tests
+
+-------------------------------------------------------------------
New:
----
changes-in-Django.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-django-js-asset.spec ++++++
--- /var/tmp/diff_new_pack.hXWf66/_old 2020-09-12 00:13:17.065258455 +0200
+++ /var/tmp/diff_new_pack.hXWf66/_new 2020-09-12 00:13:17.069258459 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-django-js-asset
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,9 +25,10 @@
Group: Development/Languages/Python
URL: https://github.com/matthiask/django-js-asset/
Source:
https://github.com/matthiask/django-js-asset/archive/%{version}.tar.gz
-BuildRequires: %{python_module setuptools}
+Patch0: changes-in-Django.patch
BuildRequires: %{python_module Django}
BuildRequires: %{python_module pytz}
+BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-Django
@@ -41,6 +42,7 @@
%prep
%setup -q -n django-js-asset-%{version}
+%patch0 -p1
%build
%python_build
++++++ changes-in-Django.patch ++++++
>From 232536ba50a2e1a0cffc6046dbcdfdec22cb0d9e Mon Sep 17 00:00:00 2001
From: Matthias Kestenholz <[email protected]>
Date: Fri, 15 May 2020 08:51:33 +0200
Subject: [PATCH] Adapt the test suite to changes in Django
---
tests/testapp/test_js_asset.py | 16 ++++++++++++----
tox.ini | 14 ++++++++++++++
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/tests/testapp/test_js_asset.py b/tests/testapp/test_js_asset.py
index 902e2a1..3762da6 100644
--- 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,
)