Skip to content

Commit

Permalink
Merge pull request #305
Browse files Browse the repository at this point in the history
feat: Upgrade to django 4.2
  • Loading branch information
kennethlove authored Oct 9, 2024
2 parents b2f6477 + 6292b5f commit 43e1552
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 57 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Direct Contributors
* Sam Spencer
* Ben Wilber
* Mfon Eti-mfon
* Irtaza Akram


Other Contributors
==================
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.15.0
current_version = 1.16.0
commit = True
tag = True

Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def parse_dist_meta():
"Framework :: Django",
"Framework :: Django :: 2.2",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
Expand Down
1 change: 0 additions & 1 deletion tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
TIME_ZONE = "UTC"
LANGUAGE_CODE = "en-US"
SITE_ID = 1
USE_L10N = True
USE_TZ = True

SECRET_KEY = "local"
Expand Down
111 changes: 56 additions & 55 deletions tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
from django.contrib.auth.views import LoginView
from django.urls import path
from django.urls import include, re_path
from . import views

urlpatterns = [
# LoginRequiredMixin tests
re_path(r"^login_required/$", views.LoginRequiredView.as_view()),
path("login_required/", views.LoginRequiredView.as_view()),
# AnonymousRequiredView tests
re_path(
r"^unauthenticated_view/$",
path(
"unauthenticated_view/",
views.AnonymousRequiredView.as_view(),
name="unauthenticated_view",
),
re_path(
r"^authenticated_view/$",
path(
"authenticated_view/",
views.AuthenticatedView.as_view(),
name="authenticated_view",
),
# AjaxResponseMixin tests
re_path(r"^ajax_response/$", views.AjaxResponseView.as_view()),
path("ajax_response/", views.AjaxResponseView.as_view()),
# CreateAndRedirectToEditView tests
re_path(r"^article/create/$", views.CreateArticleView.as_view()),
re_path(
r"^article/(?P<pk>\d+)/edit/$",
path("article/create/", views.CreateArticleView.as_view()),
path(
"article/<int:pk>/edit/",
views.EditArticleView.as_view(),
name="edit_article",
),
re_path(
r"^article_list/create/$",
path(
"article_list/create/",
views.CreateArticleAndRedirectToListView.as_view(),
),
re_path(
r"^article_list_bad/create/$",
path(
"article_list_bad/create/",
views.CreateArticleAndRedirectToListViewBad.as_view(),
),
re_path(
r"^article_list/$",
path(
"article_list/",
views.ArticleListView.as_view(),
name="article_list",
),
Expand All @@ -60,80 +61,80 @@
name="canonical_model",
),
# UserFormKwargsMixin tests
re_path(r"^form_with_user_kwarg/$", views.FormWithUserKwargView.as_view()),
path("form_with_user_kwarg/", views.FormWithUserKwargView.as_view()),
# SetHeadlineMixin tests
re_path(r"^headline/$", views.HeadlineView.as_view(), name="headline"),
re_path(r"^headline/lazy/$", views.LazyHeadlineView.as_view()),
path("headline/", views.HeadlineView.as_view(), name="headline"),
path("headline/lazy/", views.LazyHeadlineView.as_view()),
re_path(r"^headline/(?P<s>[\w-]+)/$", views.DynamicHeadlineView.as_view()),
# ExtraContextMixin tests
re_path(r"^context/$", views.ContextView.as_view(), name="context"),
path("context/", views.ContextView.as_view(), name="context"),
# PermissionRequiredMixin tests
re_path(r"^permission_required/$", views.PermissionRequiredView.as_view()),
path("permission_required/", views.PermissionRequiredView.as_view()),
# MultiplePermissionsRequiredMixin tests
re_path(
r"^multiple_permissions_required/$",
path(
"multiple_permissions_required/",
views.MultiplePermissionsRequiredView.as_view(),
),
# SuperuserRequiredMixin tests
re_path(r"^superuser_required/$", views.SuperuserRequiredView.as_view()),
path("superuser_required/", views.SuperuserRequiredView.as_view()),
# StaffuserRequiredMixin tests
re_path(r"^staffuser_required/$", views.StaffuserRequiredView.as_view()),
path("staffuser_required/", views.StaffuserRequiredView.as_view()),
# GroupRequiredMixin tests
re_path(r"^group_required/$", views.GroupRequiredView.as_view()),
path("group_required/", views.GroupRequiredView.as_view()),
# UserPassesTestMixin tests
re_path(r"^user_passes_test/$", views.UserPassesTestView.as_view()),
path("user_passes_test/", views.UserPassesTestView.as_view()),
# UserPassesTestMixin tests
re_path(
r"^user_passes_test_not_implemented/$",
path(
"user_passes_test_not_implemented/",
views.UserPassesTestNotImplementedView.as_view(),
),
# CsrfExemptMixin tests
re_path(r"^csrf_exempt/$", views.CsrfExemptView.as_view()),
path("csrf_exempt/", views.CsrfExemptView.as_view()),
# JSONResponseMixin tests
re_path(r"^simple_json/$", views.SimpleJsonView.as_view()),
re_path(
r"^simple_json_custom_encoder/$", views.CustomJsonEncoderView.as_view()
path("simple_json/", views.SimpleJsonView.as_view()),
path(
"simple_json_custom_encoder/", views.CustomJsonEncoderView.as_view()
),
re_path(r"^simple_json_400/$", views.SimpleJsonBadRequestView.as_view()),
re_path(r"^article_list_json/$", views.ArticleListJsonView.as_view()),
path("simple_json_400/", views.SimpleJsonBadRequestView.as_view()),
path("article_list_json/", views.ArticleListJsonView.as_view()),
# JsonRequestResponseMixin tests
re_path(r"^json_request/$", views.JsonRequestResponseView.as_view()),
re_path(r"^json_bad_request/$", views.JsonBadRequestView.as_view()),
re_path(
r"^json_custom_bad_request/$", views.JsonCustomBadRequestView.as_view()
path("json_request/", views.JsonRequestResponseView.as_view()),
path("json_bad_request/", views.JsonBadRequestView.as_view()),
path(
"json_custom_bad_request/", views.JsonCustomBadRequestView.as_view()
),
# FormMessagesMixin tests
re_path(r"form_messages/$", views.FormMessagesView.as_view()),
path("form_messages/", views.FormMessagesView.as_view()),
# AllVerbsMixin tests
re_path(r"all_verbs/$", views.AllVerbsView.as_view()),
re_path(
r"all_verbs_no_handler/$", views.AllVerbsView.as_view(all_handler=None)
path("all_verbs/", views.AllVerbsView.as_view()),
path(
"all_verbs_no_handler/", views.AllVerbsView.as_view(all_handler=None)
),
# SSLRequiredMixin tests
re_path(r"^sslrequired/$", views.SSLRequiredView.as_view()),
path("sslrequired/", views.SSLRequiredView.as_view()),
# RecentLoginRequiredMixin tests
re_path(r"^recent_login/$", views.RecentLoginRequiredView.as_view()),
re_path(r"^outdated_login/$", views.RecentLoginRequiredView.as_view()),
path("recent_login/", views.RecentLoginRequiredView.as_view()),
path("outdated_login/", views.RecentLoginRequiredView.as_view()),
# HeaderMixin tests
re_path(r'^headers/attribute/$', views.AttributeHeaderView.as_view()),
re_path(r'^headers/method/$', views.MethodHeaderView.as_view()),
re_path(r'^headers/existing/$', views.ExistingHeaderView.as_view()),
path('headers/attribute/', views.AttributeHeaderView.as_view()),
path('headers/method/', views.MethodHeaderView.as_view()),
path('headers/existing/', views.ExistingHeaderView.as_view()),
# CacheControlMixin tests
re_path(r'^cachecontrol/public/$', views.CacheControlPublicView.as_view()),
path('cachecontrol/public/', views.CacheControlPublicView.as_view()),
# NeverCacheMixin tests
re_path(r'^nevercache/$', views.NeverCacheView.as_view()),
path('nevercache/', views.NeverCacheView.as_view()),
]

urlpatterns += [
re_path(
r"^accounts/login/$", LoginView.as_view(template_name="blank.html")
path(
"accounts/login/", LoginView.as_view(template_name="blank.html")
),
re_path(r"^auth/login/$", LoginView.as_view(template_name="blank.html")),
path("auth/login/", LoginView.as_view(template_name="blank.html")),
]

urlpatterns += [
re_path(
r"^article-canonical-namespaced/",
path(
"article-canonical-namespaced/",
include(
("tests.urls_namespaced", "tests"), namespace="some_namespace"
),
Expand Down

0 comments on commit 43e1552

Please sign in to comment.