Skip to content

Commit 43e1552

Browse files
authored
Merge pull request #305
feat: Upgrade to django 4.2
2 parents b2f6477 + 6292b5f commit 43e1552

File tree

5 files changed

+62
-57
lines changed

5 files changed

+62
-57
lines changed

CONTRIBUTORS.txt

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Direct Contributors
3333
* Sam Spencer
3434
* Ben Wilber
3535
* Mfon Eti-mfon
36+
* Irtaza Akram
37+
3638

3739
Other Contributors
3840
==================

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.15.0
2+
current_version = 1.16.0
33
commit = True
44
tag = True
55

setup.py

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ def parse_dist_meta():
5050
"Framework :: Django",
5151
"Framework :: Django :: 2.2",
5252
"Framework :: Django :: 3.2",
53+
"Framework :: Django :: 4.0",
54+
"Framework :: Django :: 4.1",
55+
"Framework :: Django :: 4.2",
5356
"Intended Audience :: Developers",
5457
"License :: OSI Approved :: BSD License",
5558
"Natural Language :: English",

tests/settings.py

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
TIME_ZONE = "UTC"
77
LANGUAGE_CODE = "en-US"
88
SITE_ID = 1
9-
USE_L10N = True
109
USE_TZ = True
1110

1211
SECRET_KEY = "local"

tests/urls.py

+56-55
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,41 @@
11
from django.contrib.auth.views import LoginView
2+
from django.urls import path
23
from django.urls import include, re_path
34
from . import views
45

56
urlpatterns = [
67
# LoginRequiredMixin tests
7-
re_path(r"^login_required/$", views.LoginRequiredView.as_view()),
8+
path("login_required/", views.LoginRequiredView.as_view()),
89
# AnonymousRequiredView tests
9-
re_path(
10-
r"^unauthenticated_view/$",
10+
path(
11+
"unauthenticated_view/",
1112
views.AnonymousRequiredView.as_view(),
1213
name="unauthenticated_view",
1314
),
14-
re_path(
15-
r"^authenticated_view/$",
15+
path(
16+
"authenticated_view/",
1617
views.AuthenticatedView.as_view(),
1718
name="authenticated_view",
1819
),
1920
# AjaxResponseMixin tests
20-
re_path(r"^ajax_response/$", views.AjaxResponseView.as_view()),
21+
path("ajax_response/", views.AjaxResponseView.as_view()),
2122
# CreateAndRedirectToEditView tests
22-
re_path(r"^article/create/$", views.CreateArticleView.as_view()),
23-
re_path(
24-
r"^article/(?P<pk>\d+)/edit/$",
23+
path("article/create/", views.CreateArticleView.as_view()),
24+
path(
25+
"article/<int:pk>/edit/",
2526
views.EditArticleView.as_view(),
2627
name="edit_article",
2728
),
28-
re_path(
29-
r"^article_list/create/$",
29+
path(
30+
"article_list/create/",
3031
views.CreateArticleAndRedirectToListView.as_view(),
3132
),
32-
re_path(
33-
r"^article_list_bad/create/$",
33+
path(
34+
"article_list_bad/create/",
3435
views.CreateArticleAndRedirectToListViewBad.as_view(),
3536
),
36-
re_path(
37-
r"^article_list/$",
37+
path(
38+
"article_list/",
3839
views.ArticleListView.as_view(),
3940
name="article_list",
4041
),
@@ -60,80 +61,80 @@
6061
name="canonical_model",
6162
),
6263
# UserFormKwargsMixin tests
63-
re_path(r"^form_with_user_kwarg/$", views.FormWithUserKwargView.as_view()),
64+
path("form_with_user_kwarg/", views.FormWithUserKwargView.as_view()),
6465
# SetHeadlineMixin tests
65-
re_path(r"^headline/$", views.HeadlineView.as_view(), name="headline"),
66-
re_path(r"^headline/lazy/$", views.LazyHeadlineView.as_view()),
66+
path("headline/", views.HeadlineView.as_view(), name="headline"),
67+
path("headline/lazy/", views.LazyHeadlineView.as_view()),
6768
re_path(r"^headline/(?P<s>[\w-]+)/$", views.DynamicHeadlineView.as_view()),
6869
# ExtraContextMixin tests
69-
re_path(r"^context/$", views.ContextView.as_view(), name="context"),
70+
path("context/", views.ContextView.as_view(), name="context"),
7071
# PermissionRequiredMixin tests
71-
re_path(r"^permission_required/$", views.PermissionRequiredView.as_view()),
72+
path("permission_required/", views.PermissionRequiredView.as_view()),
7273
# MultiplePermissionsRequiredMixin tests
73-
re_path(
74-
r"^multiple_permissions_required/$",
74+
path(
75+
"multiple_permissions_required/",
7576
views.MultiplePermissionsRequiredView.as_view(),
7677
),
7778
# SuperuserRequiredMixin tests
78-
re_path(r"^superuser_required/$", views.SuperuserRequiredView.as_view()),
79+
path("superuser_required/", views.SuperuserRequiredView.as_view()),
7980
# StaffuserRequiredMixin tests
80-
re_path(r"^staffuser_required/$", views.StaffuserRequiredView.as_view()),
81+
path("staffuser_required/", views.StaffuserRequiredView.as_view()),
8182
# GroupRequiredMixin tests
82-
re_path(r"^group_required/$", views.GroupRequiredView.as_view()),
83+
path("group_required/", views.GroupRequiredView.as_view()),
8384
# UserPassesTestMixin tests
84-
re_path(r"^user_passes_test/$", views.UserPassesTestView.as_view()),
85+
path("user_passes_test/", views.UserPassesTestView.as_view()),
8586
# UserPassesTestMixin tests
86-
re_path(
87-
r"^user_passes_test_not_implemented/$",
87+
path(
88+
"user_passes_test_not_implemented/",
8889
views.UserPassesTestNotImplementedView.as_view(),
8990
),
9091
# CsrfExemptMixin tests
91-
re_path(r"^csrf_exempt/$", views.CsrfExemptView.as_view()),
92+
path("csrf_exempt/", views.CsrfExemptView.as_view()),
9293
# JSONResponseMixin tests
93-
re_path(r"^simple_json/$", views.SimpleJsonView.as_view()),
94-
re_path(
95-
r"^simple_json_custom_encoder/$", views.CustomJsonEncoderView.as_view()
94+
path("simple_json/", views.SimpleJsonView.as_view()),
95+
path(
96+
"simple_json_custom_encoder/", views.CustomJsonEncoderView.as_view()
9697
),
97-
re_path(r"^simple_json_400/$", views.SimpleJsonBadRequestView.as_view()),
98-
re_path(r"^article_list_json/$", views.ArticleListJsonView.as_view()),
98+
path("simple_json_400/", views.SimpleJsonBadRequestView.as_view()),
99+
path("article_list_json/", views.ArticleListJsonView.as_view()),
99100
# JsonRequestResponseMixin tests
100-
re_path(r"^json_request/$", views.JsonRequestResponseView.as_view()),
101-
re_path(r"^json_bad_request/$", views.JsonBadRequestView.as_view()),
102-
re_path(
103-
r"^json_custom_bad_request/$", views.JsonCustomBadRequestView.as_view()
101+
path("json_request/", views.JsonRequestResponseView.as_view()),
102+
path("json_bad_request/", views.JsonBadRequestView.as_view()),
103+
path(
104+
"json_custom_bad_request/", views.JsonCustomBadRequestView.as_view()
104105
),
105106
# FormMessagesMixin tests
106-
re_path(r"form_messages/$", views.FormMessagesView.as_view()),
107+
path("form_messages/", views.FormMessagesView.as_view()),
107108
# AllVerbsMixin tests
108-
re_path(r"all_verbs/$", views.AllVerbsView.as_view()),
109-
re_path(
110-
r"all_verbs_no_handler/$", views.AllVerbsView.as_view(all_handler=None)
109+
path("all_verbs/", views.AllVerbsView.as_view()),
110+
path(
111+
"all_verbs_no_handler/", views.AllVerbsView.as_view(all_handler=None)
111112
),
112113
# SSLRequiredMixin tests
113-
re_path(r"^sslrequired/$", views.SSLRequiredView.as_view()),
114+
path("sslrequired/", views.SSLRequiredView.as_view()),
114115
# RecentLoginRequiredMixin tests
115-
re_path(r"^recent_login/$", views.RecentLoginRequiredView.as_view()),
116-
re_path(r"^outdated_login/$", views.RecentLoginRequiredView.as_view()),
116+
path("recent_login/", views.RecentLoginRequiredView.as_view()),
117+
path("outdated_login/", views.RecentLoginRequiredView.as_view()),
117118
# HeaderMixin tests
118-
re_path(r'^headers/attribute/$', views.AttributeHeaderView.as_view()),
119-
re_path(r'^headers/method/$', views.MethodHeaderView.as_view()),
120-
re_path(r'^headers/existing/$', views.ExistingHeaderView.as_view()),
119+
path('headers/attribute/', views.AttributeHeaderView.as_view()),
120+
path('headers/method/', views.MethodHeaderView.as_view()),
121+
path('headers/existing/', views.ExistingHeaderView.as_view()),
121122
# CacheControlMixin tests
122-
re_path(r'^cachecontrol/public/$', views.CacheControlPublicView.as_view()),
123+
path('cachecontrol/public/', views.CacheControlPublicView.as_view()),
123124
# NeverCacheMixin tests
124-
re_path(r'^nevercache/$', views.NeverCacheView.as_view()),
125+
path('nevercache/', views.NeverCacheView.as_view()),
125126
]
126127

127128
urlpatterns += [
128-
re_path(
129-
r"^accounts/login/$", LoginView.as_view(template_name="blank.html")
129+
path(
130+
"accounts/login/", LoginView.as_view(template_name="blank.html")
130131
),
131-
re_path(r"^auth/login/$", LoginView.as_view(template_name="blank.html")),
132+
path("auth/login/", LoginView.as_view(template_name="blank.html")),
132133
]
133134

134135
urlpatterns += [
135-
re_path(
136-
r"^article-canonical-namespaced/",
136+
path(
137+
"article-canonical-namespaced/",
137138
include(
138139
("tests.urls_namespaced", "tests"), namespace="some_namespace"
139140
),

0 commit comments

Comments
 (0)