Hello community,
here is the log from the commit of package python-django-crispy-forms for
openSUSE:Factory checked in at 2018-08-10 09:50:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django-crispy-forms (Old)
and /work/SRC/openSUSE:Factory/.python-django-crispy-forms.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-crispy-forms"
Fri Aug 10 09:50:19 2018 rev:2 rq:628271 version:1.7.2
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-django-crispy-forms/python-django-crispy-forms.changes
2018-08-03 12:36:35.847506852 +0200
+++
/work/SRC/openSUSE:Factory/.python-django-crispy-forms.new/python-django-crispy-forms.changes
2018-08-10 09:50:19.874323453 +0200
@@ -1,0 +2,12 @@
+Wed Aug 8 21:25:00 UTC 2018 - [email protected]
+
+- Add patches to work with django 2.0 and 2.1 properly:
+ * django-20.patch
+ * django-21.patch
+
+-------------------------------------------------------------------
+Wed Aug 8 15:50:59 UTC 2018 - [email protected]
+
+- Trim marketing from description.
+
+-------------------------------------------------------------------
New:
----
django-20.patch
django-21.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-django-crispy-forms.spec ++++++
--- /var/tmp/diff_new_pack.izAupg/_old 2018-08-10 09:50:20.770324898 +0200
+++ /var/tmp/diff_new_pack.izAupg/_new 2018-08-10 09:50:20.774324904 +0200
@@ -21,11 +21,13 @@
Name: python-%{mod_name}
Version: 1.7.2
Release: 0
-Summary: The Best Way to Have Django DRY Forms
+Summary: Django DRY Forms
License: MIT
Group: Development/Languages/Python
URL: http://github.com/maraujop/django-crispy-forms
Source:
https://files.pythonhosted.org/packages/source/d/%{mod_name}/%{mod_name}-%{version}.tar.gz
+Patch0: django-20.patch
+Patch1: django-21.patch
BuildRequires: %{python_module Django}
BuildRequires: %{python_module pytest-django}
BuildRequires: %{python_module pytest}
@@ -37,13 +39,14 @@
%python_subpackages
%description
-The best way to have Django DRY forms. Build programmatic reusable layouts out
-of components, having full control of the rendered HTML without writing HTML in
-templates. All this without breaking the standard way of doing things in
-Django, so it plays nice with any other form application.
+A module to build programmatic reusable layouts out of components
+with control over the rendered HTML without writing HTML in
+templates, and without breaking the standard way of doing things in
+Django.
%prep
%setup -q -n %{mod_name}-%{version}
+%autopatch -p1
# Remove not needed files
find . -name '*.pyc' -delete
++++++ django-20.patch ++++++
>From 7fbfe44836aa48e65e2450823c3471c06e87e84f Mon Sep 17 00:00:00 2001
From: Eugene Morozov <[email protected]>
Date: Fri, 3 Aug 2018 17:00:34 +0700
Subject: [PATCH] Fixed {% crispy_field %} incompatiblity with Django 2.0.
(#799)
---
crispy_forms/templatetags/crispy_forms_field.py | 2 +-
crispy_forms/tests/test_tags.py | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/crispy_forms/templatetags/crispy_forms_field.py
b/crispy_forms/templatetags/crispy_forms_field.py
index 739367cb..f4b9aa54 100644
--- a/crispy_forms/templatetags/crispy_forms_field.py
+++ b/crispy_forms/templatetags/crispy_forms_field.py
@@ -153,7 +153,7 @@ def render(self, context):
else:
widget.attrs[attribute_name] =
template.Variable(attribute).resolve(context)
- return field
+ return str(field)
@register.tag(name="crispy_field")
diff --git a/crispy_forms/tests/test_tags.py b/crispy_forms/tests/test_tags.py
index 1d1d52f8..4d46e54a 100644
--- a/crispy_forms/tests/test_tags.py
+++ b/crispy_forms/tests/test_tags.py
@@ -14,6 +14,17 @@
from .forms import SampleForm
+def test_crispy_field():
+ template = Template("""
+ {% load crispy_forms_field %}
+ {% for field in form %}
+ {% crispy_field field %}
+ {% endfor %}
+ """)
+ html = template.render(Context({'form': SampleForm()}))
+ assert html.count('<input') == 8
+
+
def test_as_crispy_errors_form_without_non_field_errors():
template = Template("""
{% load crispy_forms_tags %}
++++++ django-21.patch ++++++
>From add926319463eb32fadd0703a1e94f2f2b4993ec Mon Sep 17 00:00:00 2001
From: Carlton Gibson <[email protected]>
Date: Fri, 3 Aug 2018 20:57:46 +0200
Subject: [PATCH] Fix tests for Django 2.1 (#827)
* Updated tox config
* Fix test failures on Django 2.1
>From
>https://github.com/django/django/commit/98019df855fb8fb93e4e9505afeedcad29da3125
* Unpin pytest
---
crispy_forms/tests/test_form_helper.py | 6 +++---
crispy_forms/tests/test_layout.py | 2 +-
docs/crispy_tag_forms.rst | 4 ++--
5 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/crispy_forms/tests/test_form_helper.py
b/crispy_forms/tests/test_form_helper.py
index 702d2069..33f76ac1 100644
--- a/crispy_forms/tests/test_form_helper.py
+++ b/crispy_forms/tests/test_form_helper.py
@@ -389,7 +389,7 @@ def test_formset_with_helper_without_layout(settings):
html = template.render(c)
assert html.count('<form') == 1
- assert html.count("<input type='hidden' name='csrfmiddlewaretoken'") == 1
+ assert html.count('csrfmiddlewaretoken') == 1
# Check formset management form
assert 'form-TOTAL_FORMS' in html
@@ -417,7 +417,7 @@ def test_CSRF_token_POST_form():
c = Context({'form': SampleForm(), 'form_helper': form_helper,
'csrf_token': _get_new_csrf_key()})
html = template.render(c)
- assert "<input type='hidden' name='csrfmiddlewaretoken'" in html
+ assert 'csrfmiddlewaretoken' in html
def test_CSRF_token_GET_form():
@@ -431,7 +431,7 @@ def test_CSRF_token_GET_form():
c = Context({'form': SampleForm(), 'form_helper': form_helper,
'csrf_token': _get_new_csrf_key()})
html = template.render(c)
- assert "<input type='hidden' name='csrfmiddlewaretoken'" not in html
+ assert 'csrfmiddlewaretoken' not in html
def test_disable_csrf():
diff --git a/crispy_forms/tests/test_layout.py
b/crispy_forms/tests/test_layout.py
index 9a7e2558..116b329c 100644
--- a/crispy_forms/tests/test_layout.py
+++ b/crispy_forms/tests/test_layout.py
@@ -293,7 +293,7 @@ def test_formset_layout(settings):
# Check form structure
assert html.count('<form') == 1
- assert html.count("<input type='hidden' name='csrfmiddlewaretoken'") == 1
+ assert html.count('csrfmiddlewaretoken') == 1
assert 'formsets-that-rock' in html
assert 'method="post"' in html
assert 'id="thisFormsetRocks"' in html