Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions docs/internals/howto-release-django.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ any time leading up to the actual release.

* Export user information:

.. code-block:: shell
.. code-block:: shell

$ export CVE_USER=<user-email>@djangoproject.com CVE_ORG=DSF
$ export CVE_USER=<user-email>@djangoproject.com CVE_ORG=DSF

* Reserve:

.. code-block:: shell
.. code-block:: shell

$ cve --interactive reserve <quantity>
$ cve --interactive reserve <quantity>

#. Generate the relevant (private) patch(es) using ``git format-patch``, one
for the ``main`` branch and one for each stable branch being patched.
Expand Down Expand Up @@ -347,6 +347,9 @@ cut. The following items should be addressed in this branch:
features section in the release notes (:commit:`example commit
<f2d9c76aa7096ef3eed675b9eb824858f9dd81e5>`).

#. Advance the deprecation warnings (:commit:`example commit
<0c0bda7f79a2de89a55cfcc8e60467d6588f406f>`).

#. Increase the default PBKDF2 iterations in
``django.contrib.auth.hashers.PBKDF2PasswordHasher`` by about 20%
(pick a round number). Run the tests, and update the 3 failing
Expand Down
10 changes: 6 additions & 4 deletions tests/contenttypes_tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
from unittest import mock

from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.views import shortcut
from django.contrib.sites.models import Site
Expand All @@ -26,9 +27,10 @@
class ContentTypesViewsTests(TestCase):
@classmethod
def setUpTestData(cls):
# Don't use the manager to ensure the site exists with pk=1, regardless
# of whether or not it already exists.
cls.site1 = Site(pk=1, domain="testserver", name="testserver")
# Update the default site to use the testserver domain to avoid
# assertRedirects() failure: "The test client is unable to fetch
# remote URLs (got http://example.com/authors/1/)."
cls.site1 = Site(pk=settings.SITE_ID, domain="testserver", name="testserver")
cls.site1.save()
cls.author1 = Author.objects.create(name="Boris")
cls.article1 = Article.objects.create(
Expand Down Expand Up @@ -182,7 +184,7 @@ def test_shortcut_view_with_site_m2m(self, get_model):
# domains in the MockSite model.
MockSite.objects.bulk_create(
[
MockSite(pk=1, domain="example.com"),
MockSite(pk=settings.SITE_ID, domain="example.com"),
MockSite(pk=self.site_2.pk, domain=self.site_2.domain),
MockSite(pk=self.site_3.pk, domain=self.site_3.domain),
]
Expand Down
6 changes: 1 addition & 5 deletions tests/flatpages_tests/test_csrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@
ROOT_URLCONF="flatpages_tests.urls",
CSRF_FAILURE_VIEW="django.views.csrf.csrf_failure",
TEMPLATES=FLATPAGES_TEMPLATES,
SITE_ID=1,
)
class FlatpageCSRFTests(TestCase):
@classmethod
def setUpTestData(cls):
# don't use the manager because we want to ensure the site exists
# with pk=1, regardless of whether or not it already exists.
cls.site1 = Site(pk=1, domain="example.com", name="example.com")
cls.site1.save()
cls.site1 = Site.objects.get()
cls.fp1 = FlatPage.objects.create(
url="/flatpage/",
title="A Flatpage",
Expand Down
8 changes: 0 additions & 8 deletions tests/flatpages_tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@


@modify_settings(INSTALLED_APPS={"append": ["django.contrib.flatpages"]})
@override_settings(SITE_ID=1)
class FlatpageAdminFormTests(TestCase):
@classmethod
def setUpTestData(cls):
# don't use the manager because we want to ensure the site exists
# with pk=1, regardless of whether or not it already exists.
cls.site1 = Site(pk=1, domain="example.com", name="example.com")
cls.site1.save()

def setUp(self):
# Site fields cache needs to be cleared after flatpages is added to
# INSTALLED_APPS
Expand Down
7 changes: 1 addition & 6 deletions tests/flatpages_tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
class TestDataMixin:
@classmethod
def setUpTestData(cls):
# don't use the manager because we want to ensure the site exists
# with pk=1, regardless of whether or not it already exists.
cls.site1 = Site(pk=1, domain="example.com", name="example.com")
cls.site1.save()
cls.site1 = Site.objects.get()
cls.fp1 = FlatPage.objects.create(
url="/flatpage/",
title="A Flatpage",
Expand Down Expand Up @@ -65,7 +62,6 @@ def setUpTestData(cls):
],
ROOT_URLCONF="flatpages_tests.urls",
TEMPLATES=FLATPAGES_TEMPLATES,
SITE_ID=1,
)
class FlatpageMiddlewareTests(TestDataMixin, TestCase):
def test_view_flatpage(self):
Expand Down Expand Up @@ -147,7 +143,6 @@ def test_fallback_flatpage_special_chars(self):
],
ROOT_URLCONF="flatpages_tests.urls",
TEMPLATES=FLATPAGES_TEMPLATES,
SITE_ID=1,
)
class FlatpageMiddlewareAppendSlashTests(TestDataMixin, TestCase):
def test_redirect_view_flatpage(self):
Expand Down
5 changes: 1 addition & 4 deletions tests/flatpages_tests/test_sitemaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
from django.test.utils import modify_settings, override_settings


@override_settings(
ROOT_URLCONF="flatpages_tests.urls",
SITE_ID=1,
)
@override_settings(ROOT_URLCONF="flatpages_tests.urls")
@modify_settings(
INSTALLED_APPS={
"append": ["django.contrib.sitemaps", "django.contrib.flatpages"],
Expand Down
5 changes: 1 addition & 4 deletions tests/flatpages_tests/test_templatetags.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
class FlatpageTemplateTagTests(TestCase):
@classmethod
def setUpTestData(cls):
# don't use the manager because we want to ensure the site exists
# with pk=1, regardless of whether or not it already exists.
cls.site1 = Site(pk=1, domain="example.com", name="example.com")
cls.site1.save()
cls.site1 = Site.objects.get()
cls.fp1 = FlatPage.objects.create(
url="/flatpage/",
title="A Flatpage",
Expand Down
7 changes: 1 addition & 6 deletions tests/flatpages_tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
class TestDataMixin:
@classmethod
def setUpTestData(cls):
# don't use the manager because we want to ensure the site exists
# with pk=1, regardless of whether or not it already exists.
cls.site1 = Site(pk=1, domain="example.com", name="example.com")
cls.site1.save()
cls.site1 = Site.objects.get()
cls.fp1 = FlatPage.objects.create(
url="/flatpage/",
title="A Flatpage",
Expand Down Expand Up @@ -65,7 +62,6 @@ def setUpTestData(cls):
],
ROOT_URLCONF="flatpages_tests.urls",
TEMPLATES=FLATPAGES_TEMPLATES,
SITE_ID=1,
)
class FlatpageViewTests(TestDataMixin, TestCase):
def test_view_flatpage(self):
Expand Down Expand Up @@ -129,7 +125,6 @@ def test_view_flatpage_special_chars(self):
],
ROOT_URLCONF="flatpages_tests.urls",
TEMPLATES=FLATPAGES_TEMPLATES,
SITE_ID=1,
)
class FlatpageViewAppendSlashTests(TestDataMixin, TestCase):
def test_redirect_view_flatpage(self):
Expand Down
3 changes: 1 addition & 2 deletions tests/redirects_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"append": "django.contrib.redirects.middleware.RedirectFallbackMiddleware"
}
)
@override_settings(APPEND_SLASH=False, ROOT_URLCONF="redirects_tests.urls", SITE_ID=1)
@override_settings(APPEND_SLASH=False, ROOT_URLCONF="redirects_tests.urls")
class RedirectTests(TestCase):
@classmethod
def setUpTestData(cls):
Expand Down Expand Up @@ -95,7 +95,6 @@ class OverriddenRedirectFallbackMiddleware(RedirectFallbackMiddleware):
@modify_settings(
MIDDLEWARE={"append": "redirects_tests.tests.OverriddenRedirectFallbackMiddleware"}
)
@override_settings(SITE_ID=1)
class OverriddenRedirectMiddlewareTests(TestCase):
@classmethod
def setUpTestData(cls):
Expand Down
2 changes: 0 additions & 2 deletions tests/view_tests/tests/test_defaults.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import datetime

from django.contrib.sites.models import Site
from django.http import Http404
from django.template import TemplateDoesNotExist
from django.test import RequestFactory, TestCase
Expand Down Expand Up @@ -52,7 +51,6 @@ def setUpTestData(cls):
author=author,
date_created=datetime.datetime(2001, 1, 1, 21, 22, 23),
)
Site(id=1, domain="testserver", name="testserver").save()

def test_page_not_found(self):
"A 404 status is returned by the page_not_found view"
Expand Down
Loading