summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-06-27 09:39:47 -0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-06-28 16:46:18 +0200
commit42b9a23267f14be39b9b00958e18d5746783208e (patch)
treef19f6a2cd70025744ad9d668a15a0c0a5ed8aac3 /tests
parent2b03e8e9e8205ae3a3aa128764277e70b7c30803 (diff)
Fixed #30400 -- Improved typography of user facing strings.
Thanks Claude Paroz for assistance with translations.
Diffstat (limited to 'tests')
-rw-r--r--tests/admin_changelist/tests.py2
-rw-r--r--tests/admin_docs/test_views.py2
-rw-r--r--tests/admin_utils/test_logentry.py6
-rw-r--r--tests/admin_views/admin.py2
-rw-r--r--tests/admin_views/test_history_view.py4
-rw-r--r--tests/admin_views/tests.py52
-rw-r--r--tests/admin_widgets/tests.py2
-rw-r--r--tests/auth_tests/test_forms.py2
-rw-r--r--tests/auth_tests/test_validators.py6
-rw-r--r--tests/flatpages_tests/test_forms.py6
-rw-r--r--tests/forms_tests/field_tests/test_imagefield.py2
-rw-r--r--tests/forms_tests/tests/test_error_messages.py2
-rw-r--r--tests/migrations/test_autodetector.py4
-rw-r--r--tests/model_fields/test_decimalfield.py2
-rw-r--r--tests/model_fields/test_durationfield.py4
-rw-r--r--tests/model_fields/test_uuid.py2
-rw-r--r--tests/model_forms/test_uuid.py2
-rw-r--r--tests/model_forms/tests.py2
-rw-r--r--tests/postgres_tests/test_hstore.py2
-rw-r--r--tests/postgres_tests/test_json.py2
-rw-r--r--tests/timezones/tests.py8
-rw-r--r--tests/utils_tests/test_text.py2
-rw-r--r--tests/validation/test_error_messages.py34
-rw-r--r--tests/view_tests/tests/test_csrf.py8
24 files changed, 80 insertions, 80 deletions
diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py
index dfd8e91451..c44fbcc875 100644
--- a/tests/admin_changelist/tests.py
+++ b/tests/admin_changelist/tests.py
@@ -1115,7 +1115,7 @@ class GetAdminLogTests(TestCase):
'{{ entry|safe }}'
'{% endfor %}'
)
- self.assertEqual(t.render(Context({})), 'Added "<User: jondoe>".')
+ self.assertEqual(t.render(Context({})), 'Added “<User: jondoe>”.')
def test_missing_args(self):
msg = "'get_admin_log' statements require two arguments"
diff --git a/tests/admin_docs/test_views.py b/tests/admin_docs/test_views.py
index 03d38bb2fd..144517ab0a 100644
--- a/tests/admin_docs/test_views.py
+++ b/tests/admin_docs/test_views.py
@@ -105,7 +105,7 @@ class AdminDocViewTests(TestDataMixin, AdminDocsTestCase):
def test_template_detail(self):
response = self.client.get(reverse('django-admindocs-templates', args=['admin_doc/template_detail.html']))
- self.assertContains(response, '<h1>Template: "admin_doc/template_detail.html"</h1>', html=True)
+ self.assertContains(response, '<h1>Template: <q>admin_doc/template_detail.html</q></h1>', html=True)
def test_missing_docutils(self):
utils.docutils_is_available = False
diff --git a/tests/admin_utils/test_logentry.py b/tests/admin_utils/test_logentry.py
index c2dec073f4..fec06c3446 100644
--- a/tests/admin_utils/test_logentry.py
+++ b/tests/admin_utils/test_logentry.py
@@ -131,9 +131,9 @@ class LogEntryTests(TestCase):
)
self.assertEqual(
logentry.get_change_message(),
- 'Changed Domain. Added article "Added article". '
- 'Changed Title and not_a_form_field for article "Changed Title". '
- 'Deleted article "Title second article".'
+ 'Changed Domain. Added article “Added article”. '
+ 'Changed Title and not_a_form_field for article “Changed Title”. '
+ 'Deleted article “Title second article”.'
)
with translation.override('fr'):
diff --git a/tests/admin_views/admin.py b/tests/admin_views/admin.py
index 44333e893f..4f39381783 100644
--- a/tests/admin_views/admin.py
+++ b/tests/admin_views/admin.py
@@ -899,7 +899,7 @@ class StateAdminForm(forms.ModelForm):
class Meta:
model = State
fields = '__all__'
- labels = {"name": "State name (from form's Meta.labels)"}
+ labels = {'name': 'State name (from form’s Meta.labels)'}
@property
def changed_data(self):
diff --git a/tests/admin_views/test_history_view.py b/tests/admin_views/test_history_view.py
index fdcb9e5267..5d8562d49e 100644
--- a/tests/admin_views/test_history_view.py
+++ b/tests/admin_views/test_history_view.py
@@ -39,7 +39,7 @@ class AdminHistoryViewTests(TestCase):
logentry = LogEntry.objects.filter(content_type__model__iexact='state').latest('id')
self.assertEqual(
logentry.get_change_message(),
- 'Changed State name (from form\'s Meta.labels), '
+ 'Changed State name (from form’s Meta.labels), '
'nolabel_form_field and not_a_form_field. '
- 'Changed City verbose_name for city "%s".' % city
+ 'Changed City verbose_name for city “%s”.' % city
)
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 203551fa39..372fa81582 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -227,7 +227,7 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
self.assertRedirects(response, reverse('admin:index'))
self.assertEqual(
[m.message for m in response.context['messages']],
- ["""section with ID "abc/<b>" doesn't exist. Perhaps it was deleted?"""]
+ ['section with ID “abc/<b>” doesn’t exist. Perhaps it was deleted?']
)
def test_basic_edit_GET_old_url_redirect(self):
@@ -248,7 +248,7 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
self.assertRedirects(response, reverse('admin:index'))
self.assertEqual(
[m.message for m in response.context['messages']],
- ["""super villain with ID "abc" doesn't exist. Perhaps it was deleted?"""]
+ ['super villain with ID “abc” doesn’t exist. Perhaps it was deleted?']
)
def test_basic_add_POST(self):
@@ -1705,7 +1705,7 @@ class AdminViewPermissionsTest(TestCase):
self.assertEqual(Article.objects.count(), 4)
article = Article.objects.latest('pk')
response = self.client.get(reverse('admin:admin_views_article_change', args=(article.pk,)))
- self.assertContains(response, '<li class="success">The article "Døm ikke" was added successfully.</li>')
+ self.assertContains(response, '<li class="success">The article “Døm ikke” was added successfully.</li>')
article.delete()
self.client.get(reverse('admin:logout'))
@@ -2113,7 +2113,7 @@ class AdminViewPermissionsTest(TestCase):
self.assertRedirects(response, reverse('admin:index'))
self.assertEqual(
[m.message for m in response.context['messages']],
- ["""article with ID "nonexistent" doesn't exist. Perhaps it was deleted?"""]
+ ['article with ID “nonexistent” doesn’t exist. Perhaps it was deleted?']
)
def test_history_view(self):
@@ -2170,7 +2170,7 @@ class AdminViewPermissionsTest(TestCase):
self.assertRedirects(response, reverse('admin:index'))
self.assertEqual(
[m.message for m in response.context['messages']],
- ["""article with ID "foo" doesn't exist. Perhaps it was deleted?"""]
+ ['article with ID “foo” doesn’t exist. Perhaps it was deleted?']
)
def test_conditionally_show_add_section_link(self):
@@ -2399,7 +2399,7 @@ class AdminViewPermissionsTest(TestCase):
response = self.client.post(reverse('admin:admin_views_article_add'), post_data, follow=True)
self.assertContains(
response,
- '<li class="success">The article "Fun &amp; games" was added successfully.</li>',
+ '<li class="success">The article “Fun &amp; games” was added successfully.</li>',
html=True
)
@@ -3689,7 +3689,7 @@ class AdminCustomQuerysetTest(TestCase):
self.assertRedirects(response, reverse('admin:index'))
self.assertEqual(
[m.message for m in response.context['messages']],
- ["""empty model with ID "1" doesn't exist. Perhaps it was deleted?"""]
+ ['empty model with ID “1” doesn’t exist. Perhaps it was deleted?']
)
def test_add_model_modeladmin_defer_qs(self):
@@ -3709,8 +3709,8 @@ class AdminCustomQuerysetTest(TestCase):
pk = CoverLetter.objects.all()[0].pk
self.assertContains(
response,
- '<li class="success">The cover letter "<a href="%s">'
- 'Candidate, Best</a>" was added successfully.</li>' %
+ '<li class="success">The cover letter “<a href="%s">'
+ 'Candidate, Best</a>” was added successfully.</li>' %
reverse('admin:admin_views_coverletter_change', args=(pk,)), html=True
)
@@ -3728,8 +3728,8 @@ class AdminCustomQuerysetTest(TestCase):
sm = ShortMessage.objects.all()[0]
self.assertContains(
response,
- '<li class="success">The short message "<a href="%s">'
- '%s</a>" was added successfully.</li>' %
+ '<li class="success">The short message “<a href="%s">'
+ '%s</a>” was added successfully.</li>' %
(reverse('admin:admin_views_shortmessage_change', args=(sm.pk,)), sm), html=True
)
@@ -3750,8 +3750,8 @@ class AdminCustomQuerysetTest(TestCase):
pk = Telegram.objects.all()[0].pk
self.assertContains(
response,
- '<li class="success">The telegram "<a href="%s">'
- 'Urgent telegram</a>" was added successfully.</li>' %
+ '<li class="success">The telegram “<a href="%s">'
+ 'Urgent telegram</a>” was added successfully.</li>' %
reverse('admin:admin_views_telegram_change', args=(pk,)), html=True
)
@@ -3769,8 +3769,8 @@ class AdminCustomQuerysetTest(TestCase):
p = Paper.objects.all()[0]
self.assertContains(
response,
- '<li class="success">The paper "<a href="%s">'
- '%s</a>" was added successfully.</li>' %
+ '<li class="success">The paper “<a href="%s">'
+ '%s</a>” was added successfully.</li>' %
(reverse('admin:admin_views_paper_change', args=(p.pk,)), p), html=True
)
@@ -3795,8 +3795,8 @@ class AdminCustomQuerysetTest(TestCase):
# representation is set by model's __str__()
self.assertContains(
response,
- '<li class="success">The cover letter "<a href="%s">'
- 'John Doe II</a>" was changed successfully.</li>' %
+ '<li class="success">The cover letter “<a href="%s">'
+ 'John Doe II</a>” was changed successfully.</li>' %
reverse('admin:admin_views_coverletter_change', args=(cl.pk,)), html=True
)
@@ -3818,8 +3818,8 @@ class AdminCustomQuerysetTest(TestCase):
# instance representation is set by __str__().
self.assertContains(
response,
- '<li class="success">The short message "<a href="%s">'
- '%s</a>" was changed successfully.</li>' %
+ '<li class="success">The short message “<a href="%s">'
+ '%s</a>” was changed successfully.</li>' %
(reverse('admin:admin_views_shortmessage_change', args=(sm.pk,)), sm), html=True
)
@@ -3843,8 +3843,8 @@ class AdminCustomQuerysetTest(TestCase):
# representation is set by model's __str__()
self.assertContains(
response,
- '<li class="success">The telegram "<a href="%s">'
- 'Telegram without typo</a>" was changed successfully.</li>' %
+ '<li class="success">The telegram “<a href="%s">'
+ 'Telegram without typo</a>” was changed successfully.</li>' %
reverse('admin:admin_views_telegram_change', args=(t.pk,)), html=True
)
@@ -3865,8 +3865,8 @@ class AdminCustomQuerysetTest(TestCase):
# instance representation is set by __str__().
self.assertContains(
response,
- '<li class="success">The paper "<a href="%s">'
- '%s</a>" was changed successfully.</li>' %
+ '<li class="success">The paper “<a href="%s">'
+ '%s</a>” was changed successfully.</li>' %
(reverse('admin:admin_views_paper_change', args=(p.pk,)), p), html=True
)
@@ -5161,8 +5161,8 @@ class UserAdminTest(TestCase):
response = self.client.get(new_user_url)
self.assertContains(
response,
- '<li class="success">The user "<a href="%s">'
- '%s</a>" was added successfully. You may edit it again below.</li>'
+ '<li class="success">The user “<a href="%s">'
+ '%s</a>” was added successfully. You may edit it again below.</li>'
% (new_user_url, new_user),
html=True,
)
@@ -5175,7 +5175,7 @@ class UserAdminTest(TestCase):
})
self.assertEqual(response.status_code, 200)
self.assertFormError(response, 'adminform', 'password', [])
- self.assertFormError(response, 'adminform', 'password2', ["The two password fields didn't match."])
+ self.assertFormError(response, 'adminform', 'password2', ['The two password fields didn’t match.'])
def test_user_fk_add_popup(self):
"""User addition through a FK popup should return the appropriate JavaScript response."""
diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py
index 18475658c9..22efcef6ce 100644
--- a/tests/admin_widgets/tests.py
+++ b/tests/admin_widgets/tests.py
@@ -181,7 +181,7 @@ class AdminFormfieldForDBFieldTests(SimpleTestCase):
f = ma.formfield_for_dbfield(Advisor._meta.get_field('companies'), request=None)
self.assertEqual(
f.help_text,
- 'Hold down "Control", or "Command" on a Mac, to select more than one.'
+ 'Hold down “Control”, or “Command” on a Mac, to select more than one.'
)
diff --git a/tests/auth_tests/test_forms.py b/tests/auth_tests/test_forms.py
index f70a7f830d..7085dcfa11 100644
--- a/tests/auth_tests/test_forms.py
+++ b/tests/auth_tests/test_forms.py
@@ -236,7 +236,7 @@ class UserCreationFormTest(TestDataMixin, TestCase):
form = UserCreationForm()
self.assertEqual(
form.fields['password1'].help_text,
- '<ul><li>Your password can&#x27;t be too similar to your other personal information.</li></ul>'
+ '<ul><li>Your password can’t be too similar to your other personal information.</li></ul>'
)
@override_settings(AUTH_PASSWORD_VALIDATORS=[
diff --git a/tests/auth_tests/test_validators.py b/tests/auth_tests/test_validators.py
index 87e3f890bb..393fbdd39c 100644
--- a/tests/auth_tests/test_validators.py
+++ b/tests/auth_tests/test_validators.py
@@ -178,7 +178,7 @@ class UserAttributeSimilarityValidatorTest(TestCase):
def test_help_text(self):
self.assertEqual(
UserAttributeSimilarityValidator().get_help_text(),
- "Your password can't be too similar to your other personal information."
+ 'Your password can’t be too similar to your other personal information.'
)
@@ -210,7 +210,7 @@ class CommonPasswordValidatorTest(SimpleTestCase):
def test_help_text(self):
self.assertEqual(
CommonPasswordValidator().get_help_text(),
- "Your password can't be a commonly used password."
+ 'Your password can’t be a commonly used password.'
)
@@ -227,7 +227,7 @@ class NumericPasswordValidatorTest(SimpleTestCase):
def test_help_text(self):
self.assertEqual(
NumericPasswordValidator().get_help_text(),
- "Your password can't be entirely numeric."
+ 'Your password can’t be entirely numeric.'
)
diff --git a/tests/flatpages_tests/test_forms.py b/tests/flatpages_tests/test_forms.py
index ce9bf449ce..e8ba462ec7 100644
--- a/tests/flatpages_tests/test_forms.py
+++ b/tests/flatpages_tests/test_forms.py
@@ -51,8 +51,8 @@ class FlatpageAdminFormTests(TestCase):
with translation.override('en'):
self.assertEqual(
form.fields['url'].help_text,
- "Example: '/about/contact/'. Make sure to have leading and "
- "trailing slashes."
+ 'Example: “/about/contact/”. Make sure to have leading and '
+ 'trailing slashes.'
)
self.assertFalse(form.is_valid())
self.assertEqual(form.errors['url'], ["URL is missing a trailing slash."])
@@ -64,7 +64,7 @@ class FlatpageAdminFormTests(TestCase):
with translation.override('en'):
self.assertEqual(
form.fields['url'].help_text,
- "Example: '/about/contact'. Make sure to have a leading slash."
+ 'Example: “/about/contact”. Make sure to have a leading slash.'
)
def test_flatpage_admin_form_url_uniqueness_validation(self):
diff --git a/tests/forms_tests/field_tests/test_imagefield.py b/tests/forms_tests/field_tests/test_imagefield.py
index e38abc332d..c33da2b353 100644
--- a/tests/forms_tests/field_tests/test_imagefield.py
+++ b/tests/forms_tests/field_tests/test_imagefield.py
@@ -66,7 +66,7 @@ class ImageFieldTest(FormFieldAssertionsMixin, SimpleTestCase):
with open(img_path, 'rb') as img_file:
img_data = img_file.read()
img_file = SimpleUploadedFile('1x1.txt', img_data)
- with self.assertRaisesMessage(ValidationError, "File extension 'txt' is not allowed."):
+ with self.assertRaisesMessage(ValidationError, 'File extension “txt” is not allowed.'):
f.clean(img_file)
def test_widget_attrs_default_accept(self):
diff --git a/tests/forms_tests/tests/test_error_messages.py b/tests/forms_tests/tests/test_error_messages.py
index aaee0bb5d3..52e436791a 100644
--- a/tests/forms_tests/tests/test_error_messages.py
+++ b/tests/forms_tests/tests/test_error_messages.py
@@ -276,7 +276,7 @@ class FormsErrorMessagesTestCase(SimpleTestCase, AssertFormErrorsMixin):
self.assertHTMLEqual(
t.render(Context({'form': f})),
'<ul class="errorlist"><li>field<ul class="errorlist">'
- '<li>&quot;&lt;script&gt;&quot; is not a valid value.</li>'
+ '<li>“&lt;script&gt;” is not a valid value.</li>'
'</ul></li></ul>'
)
diff --git a/tests/migrations/test_autodetector.py b/tests/migrations/test_autodetector.py
index b52852fb52..e9926ba3bf 100644
--- a/tests/migrations/test_autodetector.py
+++ b/tests/migrations/test_autodetector.py
@@ -1275,7 +1275,7 @@ class AutodetectorTests(TestCase):
"testapp", "model", [("id", models.AutoField(primary_key=True, validators=[
RegexValidator(
re.compile('^[-a-zA-Z0-9_]+\\Z'),
- "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.",
+ 'Enter a valid “slug” consisting of letters, numbers, underscores or hyphens.',
'invalid'
)
]))]
@@ -1292,7 +1292,7 @@ class AutodetectorTests(TestCase):
"testapp", "model", [("id", models.AutoField(primary_key=True, validators=[
RegexValidator(
re.compile('^[a-z]+\\Z', 32),
- "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.",
+ 'Enter a valid “slug” consisting of letters, numbers, underscores or hyphens.',
'invalid'
)
]))]
diff --git a/tests/model_fields/test_decimalfield.py b/tests/model_fields/test_decimalfield.py
index 893d529ed5..e284005aa0 100644
--- a/tests/model_fields/test_decimalfield.py
+++ b/tests/model_fields/test_decimalfield.py
@@ -21,7 +21,7 @@ class DecimalFieldTests(TestCase):
# Uses default rounding of ROUND_HALF_EVEN.
self.assertEqual(f.to_python(2.0625), Decimal('2.062'))
self.assertEqual(f.to_python(2.1875), Decimal('2.188'))
- msg = "'abc' value must be a decimal number."
+ msg = '“abc” value must be a decimal number.'
with self.assertRaisesMessage(ValidationError, msg):
f.to_python('abc')
diff --git a/tests/model_fields/test_durationfield.py b/tests/model_fields/test_durationfield.py
index f1c82ab8bd..58768ab1c7 100644
--- a/tests/model_fields/test_durationfield.py
+++ b/tests/model_fields/test_durationfield.py
@@ -74,8 +74,8 @@ class TestValidation(SimpleTestCase):
self.assertEqual(cm.exception.code, 'invalid')
self.assertEqual(
cm.exception.message % cm.exception.params,
- "'not a datetime' value has an invalid format. "
- "It must be in [DD] [[HH:]MM:]ss[.uuuuuu] format."
+ '“not a datetime” value has an invalid format. '
+ 'It must be in [DD] [[HH:]MM:]ss[.uuuuuu] format.'
)
diff --git a/tests/model_fields/test_uuid.py b/tests/model_fields/test_uuid.py
index c07d064d4d..11e4a689e1 100644
--- a/tests/model_fields/test_uuid.py
+++ b/tests/model_fields/test_uuid.py
@@ -133,7 +133,7 @@ class TestValidation(SimpleTestCase):
with self.assertRaises(exceptions.ValidationError) as cm:
field.clean('550e8400', None)
self.assertEqual(cm.exception.code, 'invalid')
- self.assertEqual(cm.exception.message % cm.exception.params, "'550e8400' is not a valid UUID.")
+ self.assertEqual(cm.exception.message % cm.exception.params, '“550e8400” is not a valid UUID.')
def test_uuid_instance_ok(self):
field = models.UUIDField()
diff --git a/tests/model_forms/test_uuid.py b/tests/model_forms/test_uuid.py
index 1c566efcd8..a0d59c3d03 100644
--- a/tests/model_forms/test_uuid.py
+++ b/tests/model_forms/test_uuid.py
@@ -29,5 +29,5 @@ class ModelFormBaseTest(TestCase):
def test_model_multiple_choice_field_uuid_pk(self):
f = forms.ModelMultipleChoiceField(UUIDPK.objects.all())
- with self.assertRaisesMessage(ValidationError, "'invalid_uuid' is not a valid UUID."):
+ with self.assertRaisesMessage(ValidationError, '“invalid_uuid” is not a valid UUID.'):
f.clean(['invalid_uuid'])
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py
index 42b9cf2c45..e264b6df77 100644
--- a/tests/model_forms/tests.py
+++ b/tests/model_forms/tests.py
@@ -1358,7 +1358,7 @@ class ModelFormBasicTests(TestCase):
self.assertEqual(f.errors['name'], ['This field is required.'])
self.assertEqual(
f.errors['slug'],
- ["Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens."]
+ ['Enter a valid “slug” consisting of letters, numbers, underscores or hyphens.']
)
self.assertEqual(f.cleaned_data, {'url': 'foo'})
msg = "The Category could not be created because the data didn't validate."
diff --git a/tests/postgres_tests/test_hstore.py b/tests/postgres_tests/test_hstore.py
index 1d7403fb20..4c8f787de6 100644
--- a/tests/postgres_tests/test_hstore.py
+++ b/tests/postgres_tests/test_hstore.py
@@ -251,7 +251,7 @@ class TestValidation(PostgreSQLSimpleTestCase):
with self.assertRaises(exceptions.ValidationError) as cm:
field.clean({'a': 1}, None)
self.assertEqual(cm.exception.code, 'not_a_string')
- self.assertEqual(cm.exception.message % cm.exception.params, 'The value of "a" is not a string or null.')
+ self.assertEqual(cm.exception.message % cm.exception.params, 'The value of “a” is not a string or null.')
def test_none_allowed_as_value(self):
field = HStoreField()
diff --git a/tests/postgres_tests/test_json.py b/tests/postgres_tests/test_json.py
index ee0bb6d5ea..4a67d177a8 100644
--- a/tests/postgres_tests/test_json.py
+++ b/tests/postgres_tests/test_json.py
@@ -426,7 +426,7 @@ class TestFormField(PostgreSQLSimpleTestCase):
field = forms.JSONField()
with self.assertRaises(exceptions.ValidationError) as cm:
field.clean('{some badly formed: json}')
- self.assertEqual(cm.exception.messages[0], "'{some badly formed: json}' value must be valid JSON.")
+ self.assertEqual(cm.exception.messages[0], '“{some badly formed: json}” value must be valid JSON.')
def test_formfield(self):
model_field = JSONField()
diff --git a/tests/timezones/tests.py b/tests/timezones/tests.py
index d51f1cabeb..68c7e3a7ef 100644
--- a/tests/timezones/tests.py
+++ b/tests/timezones/tests.py
@@ -1103,8 +1103,8 @@ class NewFormsTests(TestCase):
self.assertFalse(form.is_valid())
self.assertEqual(
form.errors['dt'], [
- "2011-03-27 02:30:00 couldn't be interpreted in time zone "
- "Europe/Paris; it may be ambiguous or it may not exist."
+ '2011-03-27 02:30:00 couldn’t be interpreted in time zone '
+ 'Europe/Paris; it may be ambiguous or it may not exist.'
]
)
@@ -1114,8 +1114,8 @@ class NewFormsTests(TestCase):
self.assertFalse(form.is_valid())
self.assertEqual(
form.errors['dt'], [
- "2011-10-30 02:30:00 couldn't be interpreted in time zone "
- "Europe/Paris; it may be ambiguous or it may not exist."
+ '2011-10-30 02:30:00 couldn’t be interpreted in time zone '
+ 'Europe/Paris; it may be ambiguous or it may not exist.'
]
)
diff --git a/tests/utils_tests/test_text.py b/tests/utils_tests/test_text.py
index ee04f3062c..f1a7db383c 100644
--- a/tests/utils_tests/test_text.py
+++ b/tests/utils_tests/test_text.py
@@ -250,7 +250,7 @@ class TestUtilsText(SimpleTestCase):
# The format string can be lazy. (string comes from contrib.admin)
s = format_lazy(
- gettext_lazy("Added {name} \"{object}\"."),
+ gettext_lazy('Added {name} “{object}”.'),
name='article', object='My first try',
)
with override('fr'):
diff --git a/tests/validation/test_error_messages.py b/tests/validation/test_error_messages.py
index 0869d0fc10..b8e4617886 100644
--- a/tests/validation/test_error_messages.py
+++ b/tests/validation/test_error_messages.py
@@ -13,49 +13,49 @@ class ValidationMessagesTest(TestCase):
def test_autofield_field_raises_error_message(self):
f = models.AutoField(primary_key=True)
- self._test_validation_messages(f, 'fõo', ["'fõo' value must be an integer."])
+ self._test_validation_messages(f, 'fõo', ['“fõo” value must be an integer.'])
def test_integer_field_raises_error_message(self):
f = models.IntegerField()
- self._test_validation_messages(f, 'fõo', ["'fõo' value must be an integer."])
+ self._test_validation_messages(f, 'fõo', ['“fõo” value must be an integer.'])
def test_boolean_field_raises_error_message(self):
f = models.BooleanField()
- self._test_validation_messages(f, 'fõo', ["'fõo' value must be either True or False."])
+ self._test_validation_messages(f, 'fõo', ['“fõo” value must be either True or False.'])
def test_nullable_boolean_field_raises_error_message(self):
f = models.BooleanField(null=True)
- self._test_validation_messages(f, 'fõo', ["'fõo' value must be either True, False, or None."])
+ self._test_validation_messages(f, 'fõo', ['“fõo” value must be either True, False, or None.'])
def test_float_field_raises_error_message(self):
f = models.FloatField()
- self._test_validation_messages(f, 'fõo', ["'fõo' value must be a float."])
+ self._test_validation_messages(f, 'fõo', ['“fõo” value must be a float.'])
def test_decimal_field_raises_error_message(self):
f = models.DecimalField()
- self._test_validation_messages(f, 'fõo', ["'fõo' value must be a decimal number."])
+ self._test_validation_messages(f, 'fõo', ['“fõo” value must be a decimal number.'])
def test_null_boolean_field_raises_error_message(self):
f = models.NullBooleanField()
- self._test_validation_messages(f, 'fõo', ["'fõo' value must be either None, True or False."])
+ self._test_validation_messages(f, 'fõo', ['“fõo” value must be either None, True or False.'])
def test_date_field_raises_error_message(self):
f = models.DateField()
self._test_validation_messages(
f, 'fõo',
- ["'fõo' value has an invalid date format. It must be in YYYY-MM-DD format."]
+ ['“fõo” value has an invalid date format. It must be in YYYY-MM-DD format.']
)
self._test_validation_messages(
f, 'aaaa-10-10',
- ["'aaaa-10-10' value has an invalid date format. It must be in YYYY-MM-DD format."]
+ ['“aaaa-10-10” value has an invalid date format. It must be in YYYY-MM-DD format.']
)
self._test_validation_messages(
f, '2011-13-10',
- ["'2011-13-10' value has the correct format (YYYY-MM-DD) but it is an invalid date."]
+ ['“2011-13-10” value has the correct format (YYYY-MM-DD) but it is an invalid date.']
)
self._test_validation_messages(
f, '2011-10-32',
- ["'2011-10-32' value has the correct format (YYYY-MM-DD) but it is an invalid date."]
+ ['“2011-10-32” value has the correct format (YYYY-MM-DD) but it is an invalid date.']
)
def test_datetime_field_raises_error_message(self):
@@ -63,18 +63,18 @@ class ValidationMessagesTest(TestCase):
# Wrong format
self._test_validation_messages(
f, 'fõo',
- ["'fõo' value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format."]
+ ['“fõo” value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format.']
)
# Correct format but invalid date
self._test_validation_messages(
f, '2011-10-32',
- ["'2011-10-32' value has the correct format (YYYY-MM-DD) but it is an invalid date."]
+ ['“2011-10-32” value has the correct format (YYYY-MM-DD) but it is an invalid date.']
)
# Correct format but invalid date/time
self._test_validation_messages(
f, '2011-10-32 10:10',
- ["'2011-10-32 10:10' value has the correct format (YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ]) "
- "but it is an invalid date/time."]
+ ['“2011-10-32 10:10” value has the correct format (YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ]) '
+ 'but it is an invalid date/time.']
)
def test_time_field_raises_error_message(self):
@@ -82,10 +82,10 @@ class ValidationMessagesTest(TestCase):
# Wrong format
self._test_validation_messages(
f, 'fõo',
- ["'fõo' value has an invalid format. It must be in HH:MM[:ss[.uuuuuu]] format."]
+ ['“fõo” value has an invalid format. It must be in HH:MM[:ss[.uuuuuu]] format.']
)
# Correct format but invalid time
self._test_validation_messages(
f, '25:50',
- ["'25:50' value has the correct format (HH:MM[:ss[.uuuuuu]]) but it is an invalid time."]
+ ['“25:50” value has the correct format (HH:MM[:ss[.uuuuuu]]) but it is an invalid time.']
)
diff --git a/tests/view_tests/tests/test_csrf.py b/tests/view_tests/tests/test_csrf.py
index 77f2373347..23eb87ba05 100644
--- a/tests/view_tests/tests/test_csrf.py
+++ b/tests/view_tests/tests/test_csrf.py
@@ -44,22 +44,22 @@ class CsrfViewTests(SimpleTestCase):
self.assertContains(
response,
'You are seeing this message because this HTTPS site requires a '
- '&#x27;Referer header&#x27; to be sent by your Web browser, but '
+ '“Referer header” to be sent by your Web browser, but '
'none was sent.',
status_code=403,
)
self.assertContains(
response,
- 'If you have configured your browser to disable &#x27;Referer&#x27; '
+ 'If you have configured your browser to disable “Referer” '
'headers, please re-enable them, at least for this site, or for '
- 'HTTPS connections, or for &#x27;same-origin&#x27; requests.',
+ 'HTTPS connections, or for “same-origin” requests.',
status_code=403,
)
self.assertContains(
response,
'If you are using the &lt;meta name=&quot;referrer&quot; '
'content=&quot;no-referrer&quot;&gt; tag or including the '
- '&#x27;Referrer-Policy: no-referrer&#x27; header, please remove them.',
+ '“Referrer-Policy: no-referrer” header, please remove them.',
status_code=403,
)