Merge ~lvoytek/ubuntu/+source/python-django-crispy-forms:django4-compatibility into ubuntu/+source/python-django-crispy-forms:ubuntu/devel

Proposed by Lena Voytek
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: 8f2b5af9c247e96bbb5e7c270bb6cedfb81eeccd
Proposed branch: ~lvoytek/ubuntu/+source/python-django-crispy-forms:django4-compatibility
Merge into: ubuntu/+source/python-django-crispy-forms:ubuntu/devel
Diff against target: 96 lines (+64/-1)
4 files modified
debian/changelog (+8/-0)
debian/control (+2/-1)
debian/patches/series (+1/-0)
debian/patches/support-django4.patch (+53/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Lukas Märdian (community) Approve
Canonical Server Pending
Canonical Server Reporter Pending
Review via email: mp+450376@code.launchpad.net

Description of the change

Fix test suite compatibility with Django 4 with upstream changes

PPA: https://launchpad.net/~lvoytek/+archive/ubuntu/django-4-mantic

Local autopkgtest results:

autopkgtest [13:29:06]: @@@@@@@@@@@@@@@@@@@@ summary
upstream-tests PASS
qemu-system-x86_64: terminating on signal 15 from pid 51279 (/usr/bin/python3)

To post a comment you must log in.
Revision history for this message
Michał Małoszewski (michal-maloszewski99) wrote :

LGTM, +1

Revision history for this message
Lukas Märdian (slyon) wrote :

Thank you very much!

This is a simple and clean patch, using proper DEP-3 headers and evidence was provided that the code had been properly tested (PPA build + local autopkgtests).

I confirmed the backported changes/logic matches the referenced upstream patch (https://github.com/django-crispy-forms/django-crispy-forms/commit/0d13c6c).

LGTM!

review: Approve
Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: slyon, lvoytek
Uploaders: slyon
MP auto-approved

review: Approve
Revision history for this message
Lukas Märdian (slyon) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 0686efb..63d4ca0 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+python-django-crispy-forms (1.14.0-4ubuntu1) mantic; urgency=medium
7+
8+ * d/p/support-django4.patch: Support Django 4.1 and 4.2 by overriding
9+ template settings to fix template loading in the
10+ keepcontext_context_manager test (LP: #2022089)
11+
12+ -- Lena Voytek <lena.voytek@canonical.com> Thu, 31 Aug 2023 11:55:04 -0700
13+
14 python-django-crispy-forms (1.14.0-4) unstable; urgency=medium
15
16 [ Debian Janitor ]
17diff --git a/debian/control b/debian/control
18index 1ed146f..a2d505a 100644
19--- a/debian/control
20+++ b/debian/control
21@@ -1,5 +1,6 @@
22 Source: python-django-crispy-forms
23-Maintainer: Debian Python Team <team+python@tracker.debian.org>
24+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
25+XSBC-Original-Maintainer: Debian Python Team <team+python@tracker.debian.org>
26 Uploaders:
27 Jan Dittberner <jandd@debian.org>,
28 Section: python
29diff --git a/debian/patches/series b/debian/patches/series
30index b9cf29e..39128dc 100644
31--- a/debian/patches/series
32+++ b/debian/patches/series
33@@ -1,3 +1,4 @@
34 no-remote-resources.patch
35 Sphinx-Correct-multi-line-definition-list.patch
36 Sphinx-Adding-missing-blank-line-after-markup.patch
37+support-django4.patch
38diff --git a/debian/patches/support-django4.patch b/debian/patches/support-django4.patch
39new file mode 100644
40index 0000000..f5d6957
41--- /dev/null
42+++ b/debian/patches/support-django4.patch
43@@ -0,0 +1,53 @@
44+Description: Update keepcontext_context_manager test to support Django 4
45+ To get the full django-crispy-forms test suite to work with Django 4, the
46+ keepcontext_context_manager must be provided with overriden template
47+ settings, since the default settings do not provide the necessary
48+ filesystem and app_directories loaders. This patch is created from a
49+ partial upstream commit, excluding CI, README, and setup.py changes.
50+Author: David Smith <smithdc@gmail.com>
51+Origin: backport, https://github.com/django-crispy-forms/django-crispy-forms/commit/0d13c6c9d326ba2690bc57da0aba7fd178b732a4
52+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-django-crispy-forms/+bug/2022089
53+Forwarded: not-needed
54+Last-Update: 2023-08-31
55+---
56+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
57+--- a/crispy_forms/tests/test_layout.py
58++++ b/crispy_forms/tests/test_layout.py
59+@@ -5,6 +5,7 @@
60+ from django.middleware.csrf import _get_new_csrf_string
61+ from django.shortcuts import render
62+ from django.template import Context, Template
63++from django.test.utils import override_settings
64+ from django.urls import reverse
65+ from django.utils.translation import gettext_lazy as _
66+
67+@@ -28,6 +29,7 @@
68+ SampleForm6,
69+ SelectSampleForm,
70+ )
71++from .test_settings import TEMPLATE_DIRS
72+ from .utils import contains_partial, parse_expected, parse_form
73+
74+
75+@@ -560,7 +562,20 @@
76+ assert 'class="customdivs"' in html
77+ assert 'test-markup="123"' in html
78+
79+-
80++@override_settings(
81++ TEMPLATES=[
82++ {
83++ "BACKEND": "django.template.backends.django.DjangoTemplates",
84++ "DIRS": TEMPLATE_DIRS,
85++ "OPTIONS": {
86++ "loaders": [
87++ "django.template.loaders.filesystem.Loader",
88++ "django.template.loaders.app_directories.Loader",
89++ ],
90++ },
91++ }
92++ ]
93++)
94+ @only_bootstrap
95+ def test_keepcontext_context_manager(settings):
96+ # Test case for issue #180

Subscribers

People subscribed via source and target branches

to all changes: