Skip to content

Commit 0f28e7f

Browse files
ulgensbmispelon
authored andcommitted
Update single quoted dosctrings to triple quotes
This is recommend by PEP257 for both single and multi line docstrings, and detected as a warning by Pycharm's code inspection - https://peps.python.org/pep-0257/#one-line-docstrings - https://peps.python.org/pep-0257/#multi-line-docstrings
1 parent a7b5b24 commit 0f28e7f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

djangoproject/tests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def setUpTestData(cls):
101101
DocumentRelease.objects.create(lang="en", release=r2, is_default=True)
102102

103103
def test_docs_host_excluded(self):
104-
"We get no Content-Language or Vary headers when docs host is excluded"
104+
"""We get no Content-Language or Vary headers when docs host is excluded"""
105105
with self.settings(LOCALE_MIDDLEWARE_EXCLUDED_HOSTS=[self.docs_host]):
106106
resp = self.client.get("/", headers={"host": self.docs_host})
107107

@@ -135,7 +135,7 @@ def test_docs_host_forwarded_excluded(self):
135135
self.assertNotIn("Vary", resp)
136136

137137
def test_docs_host_not_excluded(self):
138-
"We still get Content-Language when docs host is not excluded"
138+
"""We still get Content-Language when docs host is not excluded"""
139139
with self.settings(LOCALE_MIDDLEWARE_EXCLUDED_HOSTS=[]):
140140
resp = self.client.get("/", headers={"host": self.docs_host})
141141

@@ -144,15 +144,15 @@ def test_docs_host_not_excluded(self):
144144
self.assertIn("Vary", resp)
145145

146146
def test_www_host(self):
147-
"www should still use LocaleMiddleware"
147+
"""www should still use LocaleMiddleware"""
148148
with self.settings(LOCALE_MIDDLEWARE_EXCLUDED_HOSTS=[self.docs_host]):
149149
resp = self.client.get("/", headers={"host": self.www_host})
150150
self.assertEqual(resp.status_code, HTTPStatus.OK)
151151
self.assertIn("Content-Language", resp)
152152
self.assertIn("Vary", resp)
153153

154154
def test_www_host_with_port(self):
155-
"www (with a port) should still use LocaleMiddleware"
155+
"""www (with a port) should still use LocaleMiddleware"""
156156
with self.settings(LOCALE_MIDDLEWARE_EXCLUDED_HOSTS=[self.docs_host]):
157157
resp = self.client.get("/", headers={"host": "%s:8000" % self.www_host})
158158
self.assertEqual(resp.status_code, HTTPStatus.OK)

releases/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# about older release candidates. Safe to use Django's copy of get_version()
2121
# when upgrading this website to use Django 1.10.
2222
def get_version(version=None):
23-
"Return a PEP 386-compliant version number from VERSION."
23+
"""Return a PEP 386-compliant version number from VERSION."""
2424
version = get_complete_version(version)
2525

2626
# Now build the two parts of the version number:

0 commit comments

Comments
 (0)