summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNick Pope <nick@nickpope.me.uk>2022-11-04 12:33:09 +0000
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-11-10 13:52:17 +0100
commit9bd174b9a75299dce33e673a559f2b673399b971 (patch)
tree1deaac147ece269ef6a895986291d536ed334c49 /tests
parentfad070b07b8c5f5022c2867d291cb6968709f2a1 (diff)
Updated documentation and comments for RFC updates.
- Updated references to RFC 1123 to RFC 5322 - Only partial as RFC 5322 sort of sub-references RFC 1123. - Updated references to RFC 2388 to RFC 7578 - Except RFC 2388 Section 5.3 which has no equivalent. - Updated references to RFC 2396 to RFC 3986 - Updated references to RFC 2616 to RFC 9110 - Updated references to RFC 3066 to RFC 5646 - Updated references to RFC 7230 to RFC 9112 - Updated references to RFC 7231 to RFC 9110 - Updated references to RFC 7232 to RFC 9110 - Updated references to RFC 7234 to RFC 9111 - Tidied up style of text when referring to RFC documents
Diffstat (limited to 'tests')
-rw-r--r--tests/auth_tests/test_models.py4
-rw-r--r--tests/conditional_processing/tests.py2
-rw-r--r--tests/file_uploads/tests.py6
-rw-r--r--tests/httpwrappers/tests.py4
-rw-r--r--tests/mail/tests.py4
-rw-r--r--tests/middleware/tests.py2
-rw-r--r--tests/requests/tests.py6
-rw-r--r--tests/test_client/views.py3
-rw-r--r--tests/utils_tests/test_http.py2
-rw-r--r--tests/utils_tests/test_ipv6.py2
-rw-r--r--tests/view_tests/tests/test_static.py4
11 files changed, 17 insertions, 22 deletions
diff --git a/tests/auth_tests/test_models.py b/tests/auth_tests/test_models.py
index 01bb7981a4..fe1afcbdc3 100644
--- a/tests/auth_tests/test_models.py
+++ b/tests/auth_tests/test_models.py
@@ -122,8 +122,8 @@ class UserManagerTestCase(TransactionTestCase):
self.assertFalse(user.has_usable_password())
def test_create_user_email_domain_normalize_rfc3696(self):
- # According to https://tools.ietf.org/html/rfc3696#section-3
- # the "@" symbol can be part of the local part of an email address
+ # According to RFC 3696 Section 3 the "@" symbol can be part of the
+ # local part of an email address.
returned = UserManager.normalize_email(r"Abc\@DEF@EXAMPLE.com")
self.assertEqual(returned, r"Abc\@DEF@example.com")
diff --git a/tests/conditional_processing/tests.py b/tests/conditional_processing/tests.py
index 93f96546aa..67007b5d66 100644
--- a/tests/conditional_processing/tests.py
+++ b/tests/conditional_processing/tests.py
@@ -143,7 +143,7 @@ class ConditionalGet(SimpleTestCase):
self.assertEqual(response.status_code, 412)
def test_both_headers(self):
- # see https://tools.ietf.org/html/rfc7232#section-6
+ # See RFC 9110 Section 13.2.2.
self.client.defaults["HTTP_IF_MODIFIED_SINCE"] = LAST_MODIFIED_STR
self.client.defaults["HTTP_IF_NONE_MATCH"] = ETAG
response = self.client.get("/condition/")
diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py
index c6d76aa4c9..d5377488ff 100644
--- a/tests/file_uploads/tests.py
+++ b/tests/file_uploads/tests.py
@@ -189,8 +189,7 @@ class FileUploadTests(TestCase):
def test_unicode_file_name_rfc2231(self):
"""
- Test receiving file upload when filename is encoded with RFC2231
- (#22971).
+ Receiving file upload when filename is encoded with RFC 2231.
"""
payload = client.FakePayload()
payload.write(
@@ -219,8 +218,7 @@ class FileUploadTests(TestCase):
def test_unicode_name_rfc2231(self):
"""
- Test receiving file upload when filename is encoded with RFC2231
- (#22971).
+ Receiving file upload when filename is encoded with RFC 2231.
"""
payload = client.FakePayload()
payload.write(
diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py
index 6ab0cc52cb..e1920e2eda 100644
--- a/tests/httpwrappers/tests.py
+++ b/tests/httpwrappers/tests.py
@@ -827,7 +827,7 @@ class CookieTests(unittest.TestCase):
)
def test_cookie_edgecases(self):
- # Cookies that RFC6265 allows.
+ # Cookies that RFC 6265 allows.
self.assertEqual(
parse_cookie("a=b; Domain=example.com"), {"a": "b", "Domain": "example.com"}
)
@@ -837,7 +837,7 @@ class CookieTests(unittest.TestCase):
def test_invalid_cookies(self):
"""
- Cookie strings that go against RFC6265 but browsers will send if set
+ Cookie strings that go against RFC 6265 but browsers will send if set
via document.cookie.
"""
# Chunks without an equals sign appear as unnamed values per
diff --git a/tests/mail/tests.py b/tests/mail/tests.py
index 183a0c0ab1..54a136c1a9 100644
--- a/tests/mail/tests.py
+++ b/tests/mail/tests.py
@@ -1234,8 +1234,8 @@ class BaseEmailBackendTests(HeadersCheckMixin):
def test_send_long_lines(self):
"""
- Email line length is limited to 998 chars by the RFC:
- https://tools.ietf.org/html/rfc5322#section-2.1.1
+ Email line length is limited to 998 chars by the RFC 5322 Section
+ 2.1.1.
Message body containing longer lines are converted to Quoted-Printable
to avoid having to insert newlines, which could be hairy to do properly.
"""
diff --git a/tests/middleware/tests.py b/tests/middleware/tests.py
index 6009350365..50ba268832 100644
--- a/tests/middleware/tests.py
+++ b/tests/middleware/tests.py
@@ -640,7 +640,7 @@ class ConditionalGetMiddlewareTest(SimpleTestCase):
def test_not_modified_headers(self):
"""
The 304 Not Modified response should include only the headers required
- by section 4.1 of RFC 7232, Last-Modified, and the cookies.
+ by RFC 9110 Section 15.4.5, Last-Modified, and the cookies.
"""
def get_response(req):
diff --git a/tests/requests/tests.py b/tests/requests/tests.py
index d8068583a7..833d68946b 100644
--- a/tests/requests/tests.py
+++ b/tests/requests/tests.py
@@ -425,10 +425,8 @@ class RequestsTests(SimpleTestCase):
Multipart POST requests with Content-Length >= 0 are valid and need to
be handled.
"""
- # According to:
- # https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
- # Every request.POST with Content-Length >= 0 is a valid request,
- # this test ensures that we handle Content-Length == 0.
+ # According to RFC 9110 Section 8.6 every POST with Content-Length >= 0
+ # is a valid request, so ensure that we handle Content-Length == 0.
payload = FakePayload(
"\r\n".join(
[
diff --git a/tests/test_client/views.py b/tests/test_client/views.py
index 01850257b5..494844009d 100644
--- a/tests/test_client/views.py
+++ b/tests/test_client/views.py
@@ -395,8 +395,7 @@ def django_project_redirect(request):
def no_trailing_slash_external_redirect(request):
"""
- RFC 2616 3.2.2: A bare domain without any abs_path element should be
- treated as having the trailing `/`.
+ RFC 3986 Section 6.2.3: Empty path should be normalized to "/".
Use https://testserver, rather than an external domain, in order to allow
use of follow=True, triggering Client._handle_redirects().
diff --git a/tests/utils_tests/test_http.py b/tests/utils_tests/test_http.py
index 9978c7bb52..add9625685 100644
--- a/tests/utils_tests/test_http.py
+++ b/tests/utils_tests/test_http.py
@@ -329,7 +329,7 @@ class ETagProcessingTests(unittest.TestCase):
)
self.assertEqual(parse_etags("*"), ["*"])
- # Ignore RFC 2616 ETags that are invalid according to RFC 7232.
+ # Ignore RFC 2616 ETags that are invalid according to RFC 9110.
self.assertEqual(parse_etags(r'"etag", "e\"t\"ag"'), ['"etag"'])
def test_quoting(self):
diff --git a/tests/utils_tests/test_ipv6.py b/tests/utils_tests/test_ipv6.py
index b41778693d..bf78ed91c0 100644
--- a/tests/utils_tests/test_ipv6.py
+++ b/tests/utils_tests/test_ipv6.py
@@ -32,7 +32,7 @@ class TestUtilsIPv6(unittest.TestCase):
self.assertFalse(is_valid_ipv6_address("::ffff:999.42.16.14"))
self.assertFalse(is_valid_ipv6_address("::ffff:zzzz:0a0a"))
# The ::1.2.3.4 format used to be valid but was deprecated
- # in rfc4291 section 2.5.5.1
+ # in RFC 4291 section 2.5.5.1.
self.assertTrue(is_valid_ipv6_address("::254.42.16.14"))
self.assertTrue(is_valid_ipv6_address("::0a0a:0a0a"))
self.assertFalse(is_valid_ipv6_address("::999.42.16.14"))
diff --git a/tests/view_tests/tests/test_static.py b/tests/view_tests/tests/test_static.py
index 003e229859..9c873b447f 100644
--- a/tests/view_tests/tests/test_static.py
+++ b/tests/view_tests/tests/test_static.py
@@ -83,7 +83,7 @@ class StaticTests(SimpleTestCase):
"""Handle bogus If-Modified-Since values gracefully
Assume that a file is modified since an invalid timestamp as per RFC
- 2616, section 14.25.
+ 9110 Section 13.1.3.
"""
file_name = "file.txt"
invalid_date = "Mon, 28 May 999999999999 28:25:26 GMT"
@@ -99,7 +99,7 @@ class StaticTests(SimpleTestCase):
"""Handle even more bogus If-Modified-Since values gracefully
Assume that a file is modified since an invalid timestamp as per RFC
- 2616, section 14.25.
+ 9110 Section 13.1.3.
"""
file_name = "file.txt"
invalid_date = ": 1291108438, Wed, 20 Oct 2010 14:05:00 GMT"