File django-21.patch of Package python-django-crispy-forms

From add926319463eb32fadd0703a1e94f2f2b4993ec Mon Sep 17 00:00:00 2001
From: Carlton Gibson <carlton.gibson@noumenal.es>
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
openSUSE Build Service is sponsored by