From 42b9a23267f14be39b9b00958e18d5746783208e Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Thu, 27 Jun 2019 09:39:47 -0700 Subject: [PATCH] Fixed #30400 -- Improved typography of user facing strings. Thanks Claude Paroz for assistance with translations. --- .../admin/locale/fr/LC_MESSAGES/django.mo | Bin 17947 -> 17948 bytes .../admin/locale/fr/LC_MESSAGES/django.po | 8 +-- django/contrib/admin/models.py | 12 ++-- django/contrib/admin/options.py | 20 +++---- django/contrib/admin/templates/admin/404.html | 2 +- django/contrib/admin/templates/admin/500.html | 2 +- .../templates/admin/auth/user/add_form.html | 2 +- .../templates/admin/delete_confirmation.html | 2 +- .../admin/delete_selected_confirmation.html | 2 +- .../contrib/admin/templates/admin/index.html | 2 +- .../admin/templates/admin/invalid_setup.html | 2 +- .../admin/templates/admin/object_history.html | 2 +- .../registration/password_change_form.html | 2 +- .../registration/password_reset_done.html | 4 +- .../registration/password_reset_email.html | 2 +- .../registration/password_reset_form.html | 2 +- .../templates/admin_doc/template_detail.html | 4 +- django/contrib/auth/forms.py | 12 ++-- .../auth/locale/fr/LC_MESSAGES/django.mo | Bin 8116 -> 8122 bytes .../auth/locale/fr/LC_MESSAGES/django.po | 6 +- django/contrib/auth/password_validation.py | 6 +- django/contrib/contenttypes/views.py | 4 +- django/contrib/flatpages/forms.py | 4 +- .../flatpages/migrations/0001_initial.py | 4 +- django/contrib/flatpages/models.py | 4 +- django/contrib/gis/db/models/fields.py | 2 +- django/contrib/gis/views.py | 2 +- django/contrib/postgres/fields/hstore.py | 2 +- django/contrib/postgres/forms/jsonb.py | 2 +- .../redirects/migrations/0001_initial.py | 4 +- django/contrib/redirects/models.py | 4 +- django/core/validators.py | 8 +-- django/db/models/fields/__init__.py | 50 ++++++++--------- django/forms/models.py | 2 +- django/forms/utils.py | 2 +- django/views/csrf.py | 32 +++++------ django/views/generic/dates.py | 2 +- django/views/generic/list.py | 4 +- django/views/static.py | 2 +- django/views/templates/default_urlconf.html | 2 +- tests/admin_changelist/tests.py | 2 +- tests/admin_docs/test_views.py | 2 +- tests/admin_utils/test_logentry.py | 6 +- tests/admin_views/admin.py | 2 +- tests/admin_views/test_history_view.py | 4 +- tests/admin_views/tests.py | 52 +++++++++--------- tests/admin_widgets/tests.py | 2 +- tests/auth_tests/test_forms.py | 2 +- tests/auth_tests/test_validators.py | 6 +- tests/flatpages_tests/test_forms.py | 6 +- .../field_tests/test_imagefield.py | 2 +- .../forms_tests/tests/test_error_messages.py | 2 +- tests/migrations/test_autodetector.py | 4 +- tests/model_fields/test_decimalfield.py | 2 +- tests/model_fields/test_durationfield.py | 4 +- tests/model_fields/test_uuid.py | 2 +- tests/model_forms/test_uuid.py | 2 +- tests/model_forms/tests.py | 2 +- tests/postgres_tests/test_hstore.py | 2 +- tests/postgres_tests/test_json.py | 2 +- tests/timezones/tests.py | 8 +-- tests/utils_tests/test_text.py | 2 +- tests/validation/test_error_messages.py | 34 ++++++------ tests/view_tests/tests/test_csrf.py | 8 +-- 64 files changed, 195 insertions(+), 195 deletions(-) diff --git a/django/contrib/admin/locale/fr/LC_MESSAGES/django.mo b/django/contrib/admin/locale/fr/LC_MESSAGES/django.mo index 213fd357d1b3d5bc77c42b81e0c6aa82cbb48048..31dd63c7719233a0568e7b260a22b2f9ee4d71e7 100644 GIT binary patch delta 3029 zcmZA32~bsa6vy%NaQE>LSrnJ@xgelIpt)pdBoLRL<9av~=c5m!qRbkgA2nZR)N|dDf7Z)& z2-f3xY?KA95rb)*sD;b0EtVs5+A(a6U!fkT5p9-+u~-AMQ1|6vT^x!Ed^Bp|DX9BO zQ2~`mE*{a8E3tOyfu0+!=ejN+z|xEJ5TMABB}j-j6a z3>DaARAv4|1?FY-3~Y>=e@KvlBAbc>aR#=+b2tX8FboUgoCU_90-c0Cu>`B*J}kyV zI0!RIPxG$Ca9oReZX2qSyWH!+LkwDQ;y9{=*H95xp%$*&*odt^WH&4cX$MP3 z1(1Wv@F~=Nx$bcRYQZA+_*HDe@lx~}`(MeR87DqQKYon?)Ls2x63)hh*cJQGv0Atc zwcrX=rW;X#Zby}VKTF|u!tShZe=#6w>rNR`@mZu_Yz|Js z3e>_4{bs$f2WH{x*bdKOAFSToEE@;lEL@G+(w6M+U`#p(Jj>`NjYQl@y8L!}6jBn{w;vKBU@orR4eT1*zG35W==0M^3iQO%l%wQ(}~F^Fkc zu7N6W3fV5ZifY38Y9dYl%g1N3CW_LP$gFY-sFUxP2Gz@n_!bp-HNN9IuGf|N)3BDtiH7(b>VW{N zw2Ltk-$cF{wjGt}86;-AgMLhX*a@INYM$Y!y)MQEScdDd9Mwy`(w$}=pHBT%vI=pF3?;H&jVSp(YAq7%oIrYB4H-EvV+) zgX*nQs4e*s8{-Wm;V_E~HS#t|R?NJ(_ug>ztbXP=-0S7d?)V;|TyF=Dg_d};JWE1f zdUyF|a5|pf>HH>yD#8;ytwTq`hkDkAl6=iPTSM7C-CyF%@^lIv@U`_U4_)&m#7^bz ze|{9IS~owG9MRHK8tNa>*VCi2A|f#?;==S*#p8yJ&Kn*mxiEco<>|wT9jqn$bEXW%(qOj!OGu#=U=uDAR$Q=G;e|+Nbd$$)R6;|GkiuU|}mDrdX zQI(mkJ9!!nPR`03n>R5xFm7U3f4^~gBMJik_9>|;ohpkG?oO&ZI@Pgxm{|b FzX9zCg*pHL delta 3018 zcmYk;eN0t#9LMqBAs@ku2qL1QR}_KdDi4N%4=7NKG}F|~<#Zs3I+g6=Bn+=6P4S_j zC+3(Wk}gvl%uuLBnt!O7YmS)ZR=U)wYmwTtO*6ONAI@pTz}N3Q{eIu?_xC+#*6+0T z?X+q>4GcEMw1*kf3om0I{24>>7CwUyu`fPyuLlh7>}osxy>Ea1CKEU`$ibk6DOgrPsd=Kiwb-( zYT?zW`_`iZs>CR)LakdL5pWi2<%9ybhLLz1hv45>j!^@RS&KE;ghAZ243FbM98B7( zTs!Ldv#7v+LRIE>RA5hV8U_=^aGVifpvYF@d|Zp8@jR}=E)2qj?2{H)gbK76b8$8H zz|U|4w&4OyBR$Q#1N-3~)N>7}N*;Ev2ih2@v3$^fHND<6a)C2=43%g*V zk#;air~sy*GR#KZH^)6*h+1&Ddt8n~Io^sPhW$UtU<4Z|*T5Su>6@Bx63( zC#C||;cnEzy}icF#8k|~04CvioP`fDA9F?;^B(R(ZD|Di`#KIsCAJ>*R&2(A23r}Z zl)F%o)uZ<85UO-1T)%LypF(AR4mDvXPQz==YdJ6)N8Su?85u`~nCJ94uKB^fDa4POWJrjBzyOj*b-m_n?b$hRL`T&Db z*Ap-jCm=73c?q@Gr5J(bsDyT+ddo)j+DZ5LdkiSUhYa*-9LY5>QBR(WKKlk8>k2TsM6XP zhWn9khG|A++KI$$9-$Y)@Z)lhZ($?On&u>QA2)FP1l0rU z1Jj)Vs!*lbh5fM()oe%HRJ74cQCbh%pHr5?1GRqYl~eQl4lwFYDk-> zg0sqc6Mx2T>=$pv+ZXyRvFhwZ&j@R?o$pDrn(RtXo>gL>^^CQ~*nfE9BlV8_`=e0R zy2kc}jZJ8%hgT7B4NUjBWWbtiu`-8<*gmNc6{gecrf)rOOM} zlob0D{dPlmOw50`k25*lSBktFmaQmWRphT6*U}>*!utP=aRYmXkD2God8@dfY(?oB zUv5EJai%vlIVHoFoZ?GKXP7x5b!>7BK}bi`(n~ayD({COIK2I^gj}D BbL{{C diff --git a/django/contrib/admin/locale/fr/LC_MESSAGES/django.po b/django/contrib/admin/locale/fr/LC_MESSAGES/django.po index 4483ced676..d6306c8110 100644 --- a/django/contrib/admin/locale/fr/LC_MESSAGES/django.po +++ b/django/contrib/admin/locale/fr/LC_MESSAGES/django.po @@ -131,7 +131,7 @@ msgid "Added \"%(object)s\"." msgstr "Ajout de « %(object)s »." #, python-format -msgid "Changed \"%(object)s\" - %(changes)s" +msgid "Changed “%(object)s” - %(changes)s" msgstr "Modification de « %(object)s » - %(changes)s" #, python-format @@ -142,7 +142,7 @@ msgid "LogEntry Object" msgstr "Objet de journal" #, python-brace-format -msgid "Added {name} \"{object}\"." +msgid "Added {name} “{object}”." msgstr "Ajout de {name} « {object} »." msgid "Added." @@ -152,7 +152,7 @@ msgid "and" msgstr "et" #, python-brace-format -msgid "Changed {fields} for {name} \"{object}\"." +msgid "Changed {fields} for {name} “{object}”." msgstr "Modification de {fields} pour l'objet {name} « {object} »." #, python-brace-format @@ -160,7 +160,7 @@ msgid "Changed {fields}." msgstr "Modification de {fields}." #, python-brace-format -msgid "Deleted {name} \"{object}\"." +msgid "Deleted {name} “{object}”." msgstr "Suppression de {name} « {object} »." msgid "No fields changed." diff --git a/django/contrib/admin/models.py b/django/contrib/admin/models.py index eed5f51c57..0b2b779d7a 100644 --- a/django/contrib/admin/models.py +++ b/django/contrib/admin/models.py @@ -73,14 +73,14 @@ class LogEntry(models.Model): def __str__(self): if self.is_addition(): - return gettext('Added "%(object)s".') % {'object': self.object_repr} + return gettext('Added “%(object)s”.') % {'object': self.object_repr} elif self.is_change(): - return gettext('Changed "%(object)s" - %(changes)s') % { + return gettext('Changed “%(object)s” — %(changes)s') % { 'object': self.object_repr, 'changes': self.get_change_message(), } elif self.is_deletion(): - return gettext('Deleted "%(object)s."') % {'object': self.object_repr} + return gettext('Deleted “%(object)s.”') % {'object': self.object_repr} return gettext('LogEntry Object') @@ -108,7 +108,7 @@ class LogEntry(models.Model): if 'added' in sub_message: if sub_message['added']: sub_message['added']['name'] = gettext(sub_message['added']['name']) - messages.append(gettext('Added {name} "{object}".').format(**sub_message['added'])) + messages.append(gettext('Added {name} “{object}”.').format(**sub_message['added'])) else: messages.append(gettext('Added.')) @@ -118,7 +118,7 @@ class LogEntry(models.Model): ) if 'name' in sub_message['changed']: sub_message['changed']['name'] = gettext(sub_message['changed']['name']) - messages.append(gettext('Changed {fields} for {name} "{object}".').format( + messages.append(gettext('Changed {fields} for {name} “{object}”.').format( **sub_message['changed'] )) else: @@ -126,7 +126,7 @@ class LogEntry(models.Model): elif 'deleted' in sub_message: sub_message['deleted']['name'] = gettext(sub_message['deleted']['name']) - messages.append(gettext('Deleted {name} "{object}".').format(**sub_message['deleted'])) + messages.append(gettext('Deleted {name} “{object}”.').format(**sub_message['deleted'])) change_message = ' '.join(msg[0].upper() + msg[1:] for msg in messages) return change_message or gettext('No fields changed.') diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 22d5e6da3e..137e6faa0f 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -269,7 +269,7 @@ class BaseModelAdmin(metaclass=forms.MediaDefiningClass): form_field = db_field.formfield(**kwargs) if (isinstance(form_field.widget, SelectMultiple) and not isinstance(form_field.widget, (CheckboxSelectMultiple, AutocompleteSelectMultiple))): - msg = _('Hold down "Control", or "Command" on a Mac, to select more than one.') + msg = _('Hold down “Control”, or “Command” on a Mac, to select more than one.') help_text = form_field.help_text form_field.help_text = format_lazy('{} {}', help_text, msg) if help_text else msg return form_field @@ -1202,7 +1202,7 @@ class ModelAdmin(BaseModelAdmin): "_saveasnew" in request.POST and self.save_as_continue and self.has_change_permission(request, obj) ): - msg = _('The {name} "{obj}" was added successfully.') + msg = _('The {name} “{obj}” was added successfully.') if self.has_change_permission(request, obj): msg += ' ' + _('You may edit it again below.') self.message_user(request, format_html(msg, **msg_dict), messages.SUCCESS) @@ -1216,7 +1216,7 @@ class ModelAdmin(BaseModelAdmin): elif "_addanother" in request.POST: msg = format_html( - _('The {name} "{obj}" was added successfully. You may add another {name} below.'), + _('The {name} “{obj}” was added successfully. You may add another {name} below.'), **msg_dict ) self.message_user(request, msg, messages.SUCCESS) @@ -1226,7 +1226,7 @@ class ModelAdmin(BaseModelAdmin): else: msg = format_html( - _('The {name} "{obj}" was added successfully.'), + _('The {name} “{obj}” was added successfully.'), **msg_dict ) self.message_user(request, msg, messages.SUCCESS) @@ -1266,7 +1266,7 @@ class ModelAdmin(BaseModelAdmin): } if "_continue" in request.POST: msg = format_html( - _('The {name} "{obj}" was changed successfully. You may edit it again below.'), + _('The {name} “{obj}” was changed successfully. You may edit it again below.'), **msg_dict ) self.message_user(request, msg, messages.SUCCESS) @@ -1276,7 +1276,7 @@ class ModelAdmin(BaseModelAdmin): elif "_saveasnew" in request.POST: msg = format_html( - _('The {name} "{obj}" was added successfully. You may edit it again below.'), + _('The {name} “{obj}” was added successfully. You may edit it again below.'), **msg_dict ) self.message_user(request, msg, messages.SUCCESS) @@ -1289,7 +1289,7 @@ class ModelAdmin(BaseModelAdmin): elif "_addanother" in request.POST: msg = format_html( - _('The {name} "{obj}" was changed successfully. You may add another {name} below.'), + _('The {name} “{obj}” was changed successfully. You may add another {name} below.'), **msg_dict ) self.message_user(request, msg, messages.SUCCESS) @@ -1301,7 +1301,7 @@ class ModelAdmin(BaseModelAdmin): else: msg = format_html( - _('The {name} "{obj}" was changed successfully.'), + _('The {name} “{obj}” was changed successfully.'), **msg_dict ) self.message_user(request, msg, messages.SUCCESS) @@ -1422,7 +1422,7 @@ class ModelAdmin(BaseModelAdmin): self.message_user( request, - _('The %(name)s "%(obj)s" was deleted successfully.') % { + _('The %(name)s “%(obj)s” was deleted successfully.') % { 'name': opts.verbose_name, 'obj': obj_display, }, @@ -1501,7 +1501,7 @@ class ModelAdmin(BaseModelAdmin): Create a message informing the user that the object doesn't exist and return a redirect to the admin index page. """ - msg = _("""%(name)s with ID "%(key)s" doesn't exist. Perhaps it was deleted?""") % { + msg = _('%(name)s with ID “%(key)s” doesn’t exist. Perhaps it was deleted?') % { 'name': opts.verbose_name, 'key': unquote(object_id), } diff --git a/django/contrib/admin/templates/admin/404.html b/django/contrib/admin/templates/admin/404.html index 9bf4293e76..57b6d33780 100644 --- a/django/contrib/admin/templates/admin/404.html +++ b/django/contrib/admin/templates/admin/404.html @@ -7,6 +7,6 @@

{% trans 'Page not found' %}

-

{% trans "We're sorry, but the requested page could not be found." %}

+

{% trans 'We’re sorry, but the requested page could not be found.' %}

{% endblock %} diff --git a/django/contrib/admin/templates/admin/500.html b/django/contrib/admin/templates/admin/500.html index 4842faa656..89a6f65b38 100644 --- a/django/contrib/admin/templates/admin/500.html +++ b/django/contrib/admin/templates/admin/500.html @@ -12,6 +12,6 @@ {% block content %}

{% trans 'Server Error (500)' %}

-

{% trans "There's been an error. It's been reported to the site administrators via email and should be fixed shortly. Thanks for your patience." %}

+

{% trans 'There’s been an error. It’s been reported to the site administrators via email and should be fixed shortly. Thanks for your patience.' %}

{% endblock %} diff --git a/django/contrib/admin/templates/admin/auth/user/add_form.html b/django/contrib/admin/templates/admin/auth/user/add_form.html index 5c240d5a6a..f12c66e30d 100644 --- a/django/contrib/admin/templates/admin/auth/user/add_form.html +++ b/django/contrib/admin/templates/admin/auth/user/add_form.html @@ -3,7 +3,7 @@ {% block form_top %} {% if not is_popup %} -

{% trans "First, enter a username and password. Then, you'll be able to edit more user options." %}

+

{% trans 'First, enter a username and password. Then, you’ll be able to edit more user options.' %}

{% else %}

{% trans "Enter a username and password." %}

{% endif %} diff --git a/django/contrib/admin/templates/admin/delete_confirmation.html b/django/contrib/admin/templates/admin/delete_confirmation.html index c28a87cd9b..d9e41717a0 100644 --- a/django/contrib/admin/templates/admin/delete_confirmation.html +++ b/django/contrib/admin/templates/admin/delete_confirmation.html @@ -44,7 +44,7 @@ {% if is_popup %}{% endif %} {% if to_field %}{% endif %} - + {% trans "No, take me back" %} diff --git a/django/contrib/admin/templates/admin/delete_selected_confirmation.html b/django/contrib/admin/templates/admin/delete_selected_confirmation.html index 4d77ae33a0..ce5b163869 100644 --- a/django/contrib/admin/templates/admin/delete_selected_confirmation.html +++ b/django/contrib/admin/templates/admin/delete_selected_confirmation.html @@ -47,7 +47,7 @@ {% endfor %} - + {% trans "No, take me back" %} diff --git a/django/contrib/admin/templates/admin/index.html b/django/contrib/admin/templates/admin/index.html index 213650ccd4..746cdcdf60 100644 --- a/django/contrib/admin/templates/admin/index.html +++ b/django/contrib/admin/templates/admin/index.html @@ -48,7 +48,7 @@ {% endfor %} {% else %} -

{% trans "You don't have permission to view or edit anything." %}

+

{% trans 'You don’t have permission to view or edit anything.' %}

{% endif %} {% endblock %} diff --git a/django/contrib/admin/templates/admin/invalid_setup.html b/django/contrib/admin/templates/admin/invalid_setup.html index 7c711072d6..c86ae31509 100644 --- a/django/contrib/admin/templates/admin/invalid_setup.html +++ b/django/contrib/admin/templates/admin/invalid_setup.html @@ -9,5 +9,5 @@ {% endblock %} {% block content %} -

{% trans "Something's wrong with your database installation. Make sure the appropriate database tables have been created, and make sure the database is readable by the appropriate user." %}

+

{% trans 'Something’s wrong with your database installation. Make sure the appropriate database tables have been created, and make sure the database is readable by the appropriate user.' %}

{% endblock %} diff --git a/django/contrib/admin/templates/admin/object_history.html b/django/contrib/admin/templates/admin/object_history.html index f512aa1d1c..52b3c77051 100644 --- a/django/contrib/admin/templates/admin/object_history.html +++ b/django/contrib/admin/templates/admin/object_history.html @@ -35,7 +35,7 @@ {% else %} -

{% trans "This object doesn't have a change history. It probably wasn't added via this admin site." %}

+

{% trans 'This object doesn’t have a change history. It probably wasn’t added via this admin site.' %}

{% endif %} diff --git a/django/contrib/admin/templates/registration/password_change_form.html b/django/contrib/admin/templates/registration/password_change_form.html index 8c26108c6e..2cc4dbec06 100644 --- a/django/contrib/admin/templates/registration/password_change_form.html +++ b/django/contrib/admin/templates/registration/password_change_form.html @@ -23,7 +23,7 @@ {% endif %} -

{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}

+

{% trans 'Please enter your old password, for security’s sake, and then enter your new password twice so we can verify you typed it in correctly.' %}

diff --git a/django/contrib/admin/templates/registration/password_reset_done.html b/django/contrib/admin/templates/registration/password_reset_done.html index c6fc3582cb..99aaf7a75a 100644 --- a/django/contrib/admin/templates/registration/password_reset_done.html +++ b/django/contrib/admin/templates/registration/password_reset_done.html @@ -12,8 +12,8 @@ {% block content_title %}

{{ title }}

{% endblock %} {% block content %} -

{% trans "We've emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly." %}

+

{% trans 'We’ve emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly.' %}

-

{% trans "If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder." %}

+

{% trans 'If you don’t receive an email, please make sure you’ve entered the address you registered with, and check your spam folder.' %}

{% endblock %} diff --git a/django/contrib/admin/templates/registration/password_reset_email.html b/django/contrib/admin/templates/registration/password_reset_email.html index 01b3bccbbc..9e1e94a781 100644 --- a/django/contrib/admin/templates/registration/password_reset_email.html +++ b/django/contrib/admin/templates/registration/password_reset_email.html @@ -5,7 +5,7 @@ {% block reset_link %} {{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %} {% endblock %} -{% trans "Your username, in case you've forgotten:" %} {{ user.get_username }} +{% trans 'Your username, in case you’ve forgotten:' %} {{ user.get_username }} {% trans "Thanks for using our site!" %} diff --git a/django/contrib/admin/templates/registration/password_reset_form.html b/django/contrib/admin/templates/registration/password_reset_form.html index 5c5d761d97..dccf62f367 100644 --- a/django/contrib/admin/templates/registration/password_reset_form.html +++ b/django/contrib/admin/templates/registration/password_reset_form.html @@ -13,7 +13,7 @@ {% block content_title %}

{{ title }}

{% endblock %} {% block content %} -

{% trans "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %}

+

{% trans 'Forgotten your password? Enter your email address below, and we’ll email instructions for setting a new one.' %}

{% csrf_token %}
diff --git a/django/contrib/admindocs/templates/admin_doc/template_detail.html b/django/contrib/admindocs/templates/admin_doc/template_detail.html index 3b49571ab3..1b95b25d39 100644 --- a/django/contrib/admindocs/templates/admin_doc/template_detail.html +++ b/django/contrib/admindocs/templates/admin_doc/template_detail.html @@ -13,10 +13,10 @@ {% block title %}{% blocktrans %}Template: {{ name }}{% endblocktrans %}{% endblock %} {% block content %} -

{% blocktrans %}Template: "{{ name }}"{% endblocktrans %}

+

{% blocktrans %}Template: {{ name }}{% endblocktrans %}

{# Translators: Search is not a verb here, it qualifies path (a search path) #} -

{% blocktrans %}Search path for template "{{ name }}":{% endblocktrans %}

+

{% blocktrans %}Search path for template {{ name }}:{% endblocktrans %}

    {% for template in templates|dictsort:"order" %}
  1. {{ template.file }}{% if not template.exists %} {% trans '(does not exist)' %}{% endif %}
  2. diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py index 23d5bdafed..7fbe674948 100644 --- a/django/contrib/auth/forms.py +++ b/django/contrib/auth/forms.py @@ -73,7 +73,7 @@ class UserCreationForm(forms.ModelForm): password. """ error_messages = { - 'password_mismatch': _("The two password fields didn't match."), + 'password_mismatch': _('The two password fields didn’t match.'), } password1 = forms.CharField( label=_("Password"), @@ -134,9 +134,9 @@ class UserChangeForm(forms.ModelForm): password = ReadOnlyPasswordHashField( label=_("Password"), help_text=_( - "Raw passwords are not stored, so there is no way to see this " - "user's password, but you can change the password using " - "this form." + 'Raw passwords are not stored, so there is no way to see this ' + 'user’s password, but you can change the password using ' + 'this form.' ), ) @@ -314,7 +314,7 @@ class SetPasswordForm(forms.Form): password """ error_messages = { - 'password_mismatch': _("The two password fields didn't match."), + 'password_mismatch': _('The two password fields didn’t match.'), } new_password1 = forms.CharField( label=_("New password"), @@ -387,7 +387,7 @@ class AdminPasswordChangeForm(forms.Form): A form used to change the password of a user in the admin interface. """ error_messages = { - 'password_mismatch': _("The two password fields didn't match."), + 'password_mismatch': _('The two password fields didn’t match.'), } required_css_class = 'required' password1 = forms.CharField( diff --git a/django/contrib/auth/locale/fr/LC_MESSAGES/django.mo b/django/contrib/auth/locale/fr/LC_MESSAGES/django.mo index bc0e60e6ba0161b13d72898e3ed3300aea0b041f..dd1f14ddfa5f4b493bd785d0bff7f952a2c0619d 100644 GIT binary patch delta 1054 zcmXZbPe@cz6vy%Nw0UMTjiWZ1W&bR6G%<4ogNg|zbEJX@qJ_~Sp;m`86-- zHnYLFSv!tl4&UGbF~DjZ!R2_{IgT;r1&rb|T#4^+1JOYkhdM>OY5CNT_1MwJZha0RAILg zfms!Uy9DF|RKiINJ+l|Mn|WWISsPx(O*n-ca1IA?5w&x@}(t*gzr*LrX(4&XXGi>z%oQ1?w>BR;_l&F`anqkvKJ+Y|$B>1(XSPsks@KD+rms;j?a43|)a{6iH`y|J7iiTYg= zvPrfLb$y@nFzSeoqmKLn#uON3po;FHDlVX&=yBK>8S?gqmm|HkS>}4F0D96o!|6z? z9<%g1(nN+>k;?0$P5fy| zJPC_QnxIWYNMm$CgoQ96VP(@GvC&OqVS_~zzCUv(^X7B!d2jAH@80t~|1>{6;`v!K z8;F{<;~4hg3=ZJ}hVeqoYzYqIV!Y}MFv7fqb@%|6;S4Ut*BHW&sC7Q!BK+*`e~X#_ z|G{|zO7IJ{kj1MHMo{wvDseMv;WiiFidry-Dx?Sb+97_l-U-zGK^HHg))__>b|vnc z)iSt2K;A|roWQ^{dx*Q3=a-vx;1IUp6t2Yz4&WU2V^6)=S-gfyw18y{tuVWX&#)Db zC(R1z`wS8cDlRaKdXv@$GoG~!uE$!zUqQEEvRdf?oaS8QC_k+gJDbIpSp&f|~bA40*JxO=I38jyueVDrO_sPA>ICA?OGfyx!nkxXZKhWVll6rGsKL%kSN2yO%D1 Ii2jKG13?08u>b%7 diff --git a/django/contrib/auth/locale/fr/LC_MESSAGES/django.po b/django/contrib/auth/locale/fr/LC_MESSAGES/django.po index 1e31edbcff..6d20def6ab 100644 --- a/django/contrib/auth/locale/fr/LC_MESSAGES/django.po +++ b/django/contrib/auth/locale/fr/LC_MESSAGES/django.po @@ -253,7 +253,7 @@ msgstr[1] "" msgid "The password is too similar to the %(verbose_name)s." msgstr "Le mot de passe est trop semblable au champ « %(verbose_name)s »." -msgid "Your password can't be too similar to your other personal information." +msgid "Your password can’t be too similar to your other personal information." msgstr "" "Votre mot de passe ne peut pas trop ressembler à vos autres informations " "personnelles." @@ -261,14 +261,14 @@ msgstr "" msgid "This password is too common." msgstr "Ce mot de passe est trop courant." -msgid "Your password can't be a commonly used password." +msgid "Your password can’t be a commonly used password." msgstr "" "Votre mot de passe ne peut pas être un mot de passe couramment utilisé." msgid "This password is entirely numeric." msgstr "Ce mot de passe est entièrement numérique." -msgid "Your password can't be entirely numeric." +msgid "Your password can’t be entirely numeric." msgstr "Votre mot de passe ne peut pas être entièrement numérique." #, python-format diff --git a/django/contrib/auth/password_validation.py b/django/contrib/auth/password_validation.py index 59fd726f9f..845f4d86d5 100644 --- a/django/contrib/auth/password_validation.py +++ b/django/contrib/auth/password_validation.py @@ -154,7 +154,7 @@ class UserAttributeSimilarityValidator: ) def get_help_text(self): - return _("Your password can't be too similar to your other personal information.") + return _('Your password can’t be too similar to your other personal information.') class CommonPasswordValidator: @@ -185,7 +185,7 @@ class CommonPasswordValidator: ) def get_help_text(self): - return _("Your password can't be a commonly used password.") + return _('Your password can’t be a commonly used password.') class NumericPasswordValidator: @@ -200,4 +200,4 @@ class NumericPasswordValidator: ) def get_help_text(self): - return _("Your password can't be entirely numeric.") + return _('Your password can’t be entirely numeric.') diff --git a/django/contrib/contenttypes/views.py b/django/contrib/contenttypes/views.py index 8c194839c8..3231e6bfe1 100644 --- a/django/contrib/contenttypes/views.py +++ b/django/contrib/contenttypes/views.py @@ -21,7 +21,7 @@ def shortcut(request, content_type_id, object_id): obj = content_type.get_object_for_this_type(pk=object_id) except (ObjectDoesNotExist, ValueError): raise Http404( - _("Content type %(ct_id)s object %(obj_id)s doesn't exist") % + _('Content type %(ct_id)s object %(obj_id)s doesn’t exist') % {'ct_id': content_type_id, 'obj_id': object_id} ) @@ -29,7 +29,7 @@ def shortcut(request, content_type_id, object_id): get_absolute_url = obj.get_absolute_url except AttributeError: raise Http404( - _("%(ct_name)s objects don't have a get_absolute_url() method") % + _('%(ct_name)s objects don’t have a get_absolute_url() method') % {'ct_name': content_type.name} ) absurl = get_absolute_url() diff --git a/django/contrib/flatpages/forms.py b/django/contrib/flatpages/forms.py index 4d4b5c80e4..95d9899920 100644 --- a/django/contrib/flatpages/forms.py +++ b/django/contrib/flatpages/forms.py @@ -9,7 +9,7 @@ class FlatpageForm(forms.ModelForm): label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$', - help_text=_("Example: '/about/contact/'. Make sure to have leading and trailing slashes."), + help_text=_('Example: “/about/contact/”. Make sure to have leading and trailing slashes.'), error_messages={ "invalid": _( "This value must contain only letters, numbers, dots, " @@ -26,7 +26,7 @@ class FlatpageForm(forms.ModelForm): super().__init__(*args, **kwargs) if not self._trailing_slash_required(): self.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 _trailing_slash_required(self): diff --git a/django/contrib/flatpages/migrations/0001_initial.py b/django/contrib/flatpages/migrations/0001_initial.py index b385ca5fd4..6bb1bfb6ef 100644 --- a/django/contrib/flatpages/migrations/0001_initial.py +++ b/django/contrib/flatpages/migrations/0001_initial.py @@ -18,8 +18,8 @@ class Migration(migrations.Migration): ('enable_comments', models.BooleanField(default=False, verbose_name='enable comments')), ('template_name', models.CharField( help_text=( - "Example: 'flatpages/contact_page.html'. If this isn't provided, the system will use " - "'flatpages/default.html'." + 'Example: “flatpages/contact_page.html”. If this isn’t provided, the system will use ' + '“flatpages/default.html”.' ), max_length=70, verbose_name='template name', blank=True )), ('registration_required', models.BooleanField( diff --git a/django/contrib/flatpages/models.py b/django/contrib/flatpages/models.py index 32e4fd1123..de726b7b89 100644 --- a/django/contrib/flatpages/models.py +++ b/django/contrib/flatpages/models.py @@ -15,8 +15,8 @@ class FlatPage(models.Model): max_length=70, blank=True, help_text=_( - "Example: 'flatpages/contact_page.html'. If this isn't provided, " - "the system will use 'flatpages/default.html'." + 'Example: “flatpages/contact_page.html”. If this isn’t provided, ' + 'the system will use “flatpages/default.html”.' ), ) registration_required = models.BooleanField( diff --git a/django/contrib/gis/db/models/fields.py b/django/contrib/gis/db/models/fields.py index 79fdbd2799..f73e26be5e 100644 --- a/django/contrib/gis/db/models/fields.py +++ b/django/contrib/gis/db/models/fields.py @@ -198,7 +198,7 @@ class GeometryField(BaseSpatialField): """ The base Geometry field -- maps to the OpenGIS Specification Geometry type. """ - description = _("The base Geometry field -- maps to the OpenGIS Specification Geometry type.") + description = _('The base Geometry field — maps to the OpenGIS Specification Geometry type.') form_class = forms.GeometryField # The OpenGIS Geometry name. geom_type = 'GEOMETRY' diff --git a/django/contrib/gis/views.py b/django/contrib/gis/views.py index 35d2b6b695..5b29db9fb2 100644 --- a/django/contrib/gis/views.py +++ b/django/contrib/gis/views.py @@ -11,7 +11,7 @@ def feed(request, url, feed_dict=None): try: f = feed_dict[slug] except KeyError: - raise Http404(_("Slug %r isn't registered.") % slug) + raise Http404(_('Slug %r isn’t registered.') % slug) instance = f() instance.feed_url = getattr(f, 'feed_url', None) or request.path diff --git a/django/contrib/postgres/fields/hstore.py b/django/contrib/postgres/fields/hstore.py index 39f074b763..de2757b693 100644 --- a/django/contrib/postgres/fields/hstore.py +++ b/django/contrib/postgres/fields/hstore.py @@ -15,7 +15,7 @@ class HStoreField(CheckFieldDefaultMixin, Field): empty_strings_allowed = False description = _('Map of strings to strings/nulls') default_error_messages = { - 'not_a_string': _('The value of "%(key)s" is not a string or null.'), + 'not_a_string': _('The value of “%(key)s” is not a string or null.'), } _default_hint = ('dict', '{}') diff --git a/django/contrib/postgres/forms/jsonb.py b/django/contrib/postgres/forms/jsonb.py index bb681e0be3..2865498d68 100644 --- a/django/contrib/postgres/forms/jsonb.py +++ b/django/contrib/postgres/forms/jsonb.py @@ -16,7 +16,7 @@ class JSONString(str): class JSONField(forms.CharField): default_error_messages = { - 'invalid': _("'%(value)s' value must be valid JSON."), + 'invalid': _('“%(value)s” value must be valid JSON.'), } widget = forms.Textarea diff --git a/django/contrib/redirects/migrations/0001_initial.py b/django/contrib/redirects/migrations/0001_initial.py index 5acf8c9be7..b3fa17cfa0 100644 --- a/django/contrib/redirects/migrations/0001_initial.py +++ b/django/contrib/redirects/migrations/0001_initial.py @@ -20,11 +20,11 @@ class Migration(migrations.Migration): )), ('old_path', models.CharField( help_text=( - "This should be an absolute path, excluding the domain name. Example: '/events/search/'." + 'This should be an absolute path, excluding the domain name. Example: “/events/search/”.' ), max_length=200, verbose_name='redirect from', db_index=True )), ('new_path', models.CharField( - help_text="This can be either an absolute path (as above) or a full URL starting with 'http://'.", + help_text='This can be either an absolute path (as above) or a full URL starting with “http://”.', max_length=200, verbose_name='redirect to', blank=True )), ], diff --git a/django/contrib/redirects/models.py b/django/contrib/redirects/models.py index 819aa331dd..100c90fc88 100644 --- a/django/contrib/redirects/models.py +++ b/django/contrib/redirects/models.py @@ -9,13 +9,13 @@ class Redirect(models.Model): _('redirect from'), max_length=200, db_index=True, - help_text=_("This should be an absolute path, excluding the domain name. Example: '/events/search/'."), + help_text=_('This should be an absolute path, excluding the domain name. Example: “/events/search/”.'), ) new_path = models.CharField( _('redirect to'), max_length=200, blank=True, - help_text=_("This can be either an absolute path (as above) or a full URL starting with 'http://'."), + help_text=_('This can be either an absolute path (as above) or a full URL starting with “http://”.'), ) class Meta: diff --git a/django/core/validators.py b/django/core/validators.py index 38e4b6aa1d..827b1eea09 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -236,14 +236,14 @@ slug_re = _lazy_re_compile(r'^[-a-zA-Z0-9_]+\Z') validate_slug = RegexValidator( slug_re, # Translators: "letters" means latin letters: a-z and A-Z. - _("Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens."), + _('Enter a valid “slug” consisting of letters, numbers, underscores or hyphens.'), 'invalid' ) slug_unicode_re = _lazy_re_compile(r'^[-\w]+\Z') validate_unicode_slug = RegexValidator( slug_unicode_re, - _("Enter a valid 'slug' consisting of Unicode letters, numbers, underscores, or hyphens."), + _('Enter a valid “slug” consisting of Unicode letters, numbers, underscores, or hyphens.'), 'invalid' ) @@ -466,8 +466,8 @@ class DecimalValidator: @deconstructible class FileExtensionValidator: message = _( - "File extension '%(extension)s' is not allowed. " - "Allowed extensions are: '%(allowed_extensions)s'." + 'File extension “%(extension)s” is not allowed. ' + 'Allowed extensions are: %(allowed_extensions)s.' ) code = 'invalid_extension' diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 4d7eb11151..6bd8f41a85 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -899,7 +899,7 @@ class AutoField(Field): empty_strings_allowed = False default_error_messages = { - 'invalid': _("'%(value)s' value must be an integer."), + 'invalid': _('“%(value)s” value must be an integer.'), } def __init__(self, *args, **kwargs): @@ -986,8 +986,8 @@ class BigAutoField(AutoField): class BooleanField(Field): empty_strings_allowed = False default_error_messages = { - 'invalid': _("'%(value)s' value must be either True or False."), - 'invalid_nullable': _("'%(value)s' value must be either True, False, or None."), + 'invalid': _('“%(value)s” value must be either True or False.'), + 'invalid_nullable': _('“%(value)s” value must be either True, False, or None.'), } description = _("Boolean (Either True or False)") @@ -1143,10 +1143,10 @@ class DateTimeCheckMixin: class DateField(DateTimeCheckMixin, Field): empty_strings_allowed = False default_error_messages = { - 'invalid': _("'%(value)s' value has an invalid date format. It must be " - "in YYYY-MM-DD format."), - 'invalid_date': _("'%(value)s' value has the correct format (YYYY-MM-DD) " - "but it is an invalid date."), + 'invalid': _('“%(value)s” value has an invalid date format. It must be ' + 'in YYYY-MM-DD format.'), + 'invalid_date': _('“%(value)s” value has the correct format (YYYY-MM-DD) ' + 'but it is an invalid date.'), } description = _("Date (without time)") @@ -1286,13 +1286,13 @@ class DateField(DateTimeCheckMixin, Field): class DateTimeField(DateField): empty_strings_allowed = False default_error_messages = { - 'invalid': _("'%(value)s' value has an invalid format. It must be in " - "YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format."), - 'invalid_date': _("'%(value)s' value has the correct format " + 'invalid': _('“%(value)s” value has an invalid format. It must be in ' + 'YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format.'), + 'invalid_date': _("“%(value)s” value has the correct format " "(YYYY-MM-DD) but it is an invalid date."), - 'invalid_datetime': _("'%(value)s' value has the correct format " - "(YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ]) " - "but it is an invalid date/time."), + 'invalid_datetime': _('“%(value)s” value has the correct format ' + '(YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ]) ' + 'but it is an invalid date/time.'), } description = _("Date (with time)") @@ -1442,7 +1442,7 @@ class DateTimeField(DateField): class DecimalField(Field): empty_strings_allowed = False default_error_messages = { - 'invalid': _("'%(value)s' value must be a decimal number."), + 'invalid': _('“%(value)s” value must be a decimal number.'), } description = _("Decimal number") @@ -1583,8 +1583,8 @@ class DurationField(Field): """ empty_strings_allowed = False default_error_messages = { - 'invalid': _("'%(value)s' value has an invalid format. It must be in " - "[DD] [[HH:]MM:]ss[.uuuuuu] format.") + 'invalid': _('“%(value)s” value has an invalid format. It must be in ' + '[DD] [[HH:]MM:]ss[.uuuuuu] format.') } description = _("Duration") @@ -1725,7 +1725,7 @@ class FilePathField(Field): class FloatField(Field): empty_strings_allowed = False default_error_messages = { - 'invalid': _("'%(value)s' value must be a float."), + 'invalid': _('“%(value)s” value must be a float.'), } description = _("Floating point number") @@ -1760,7 +1760,7 @@ class FloatField(Field): class IntegerField(Field): empty_strings_allowed = False default_error_messages = { - 'invalid': _("'%(value)s' value must be an integer."), + 'invalid': _('“%(value)s” value must be an integer.'), } description = _("Integer") @@ -1967,8 +1967,8 @@ class GenericIPAddressField(Field): class NullBooleanField(BooleanField): default_error_messages = { - 'invalid': _("'%(value)s' value must be either None, True or False."), - 'invalid_nullable': _("'%(value)s' value must be either None, True or False."), + 'invalid': _('“%(value)s” value must be either None, True or False.'), + 'invalid_nullable': _('“%(value)s” value must be either None, True or False.'), } description = _("Boolean (Either True, False or None)") @@ -2099,10 +2099,10 @@ class TextField(Field): class TimeField(DateTimeCheckMixin, Field): empty_strings_allowed = False default_error_messages = { - 'invalid': _("'%(value)s' value has an invalid format. It must be in " - "HH:MM[:ss[.uuuuuu]] format."), - 'invalid_time': _("'%(value)s' value has the correct format " - "(HH:MM[:ss[.uuuuuu]]) but it is an invalid time."), + 'invalid': _('“%(value)s” value has an invalid format. It must be in ' + 'HH:MM[:ss[.uuuuuu]] format.'), + 'invalid_time': _('“%(value)s” value has the correct format ' + '(HH:MM[:ss[.uuuuuu]]) but it is an invalid time.'), } description = _("Time") @@ -2317,7 +2317,7 @@ class BinaryField(Field): class UUIDField(Field): default_error_messages = { - 'invalid': _("'%(value)s' is not a valid UUID."), + 'invalid': _('“%(value)s” is not a valid UUID.'), } description = _('Universally unique identifier') empty_strings_allowed = False diff --git a/django/forms/models.py b/django/forms/models.py index 47df5d565a..c7e7e50885 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -1272,7 +1272,7 @@ class ModelMultipleChoiceField(ModelChoiceField): 'list': _('Enter a list of values.'), 'invalid_choice': _('Select a valid choice. %(value)s is not one of the' ' available choices.'), - 'invalid_pk_value': _('"%(pk)s" is not a valid value.') + 'invalid_pk_value': _('“%(pk)s” is not a valid value.') } def __init__(self, queryset, **kwargs): diff --git a/django/forms/utils.py b/django/forms/utils.py index 73fca86325..8bfdd0a799 100644 --- a/django/forms/utils.py +++ b/django/forms/utils.py @@ -159,7 +159,7 @@ def from_current_timezone(value): return timezone.make_aware(value, current_timezone) except Exception as exc: raise ValidationError( - _('%(datetime)s couldn\'t be interpreted ' + _('%(datetime)s couldn’t be interpreted ' 'in time zone %(current_timezone)s; it ' 'may be ambiguous or it may not exist.'), code='ambiguous_timezone', diff --git a/django/views/csrf.py b/django/views/csrf.py index b1c8d25235..27e7b5ca37 100644 --- a/django/views/csrf.py +++ b/django/views/csrf.py @@ -112,21 +112,21 @@ def csrf_failure(request, reason="", template_name=CSRF_FAILURE_TEMPLATE_NAME): 'reason': reason, 'no_referer': reason == REASON_NO_REFERER, 'no_referer1': _( - "You are seeing this message because this HTTPS site requires a " - "'Referer header' to be sent by your Web browser, but none was " - "sent. This header is required for security reasons, to ensure " - "that your browser is not being hijacked by third parties."), + 'You are seeing this message because this HTTPS site requires a ' + '“Referer header” to be sent by your Web browser, but none was ' + 'sent. This header is required for security reasons, to ensure ' + 'that your browser is not being hijacked by third parties.'), 'no_referer2': _( - "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 'same-origin' requests."), + '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 “same-origin” requests.'), 'no_referer3': _( - "If you are using the tag or including the 'Referrer-Policy: " - "no-referrer' header, please remove them. The CSRF protection " - "requires the 'Referer' header to do strict referer checking. If " - "you're concerned about privacy, use alternatives like " - " for links to third-party sites."), + 'If you are using the tag or including the “Referrer-Policy: ' + 'no-referrer” header, please remove them. The CSRF protection ' + 'requires the “Referer” header to do strict referer checking. If ' + 'you’re concerned about privacy, use alternatives like ' + ' for links to third-party sites.'), 'no_cookie': reason == REASON_NO_CSRF_COOKIE, 'no_cookie1': _( "You are seeing this message because this site requires a CSRF " @@ -134,9 +134,9 @@ def csrf_failure(request, reason="", template_name=CSRF_FAILURE_TEMPLATE_NAME): "security reasons, to ensure that your browser is not being " "hijacked by third parties."), 'no_cookie2': _( - "If you have configured your browser to disable cookies, please " - "re-enable them, at least for this site, or for 'same-origin' " - "requests."), + 'If you have configured your browser to disable cookies, please ' + 're-enable them, at least for this site, or for “same-origin” ' + 'requests.'), 'DEBUG': settings.DEBUG, 'docs_version': get_docs_version(), 'more': _("More information is available with DEBUG=True."), diff --git a/django/views/generic/dates.py b/django/views/generic/dates.py index 4380cd5464..b870301222 100644 --- a/django/views/generic/dates.py +++ b/django/views/generic/dates.py @@ -620,7 +620,7 @@ def _date_from_string(year, year_format, month='', month_format='', day='', day_ try: return datetime.datetime.strptime(datestr, format).date() except ValueError: - raise Http404(_("Invalid date string '%(datestr)s' given format '%(format)s'") % { + raise Http404(_('Invalid date string “%(datestr)s” given format “%(format)s”') % { 'datestr': datestr, 'format': format, }) diff --git a/django/views/generic/list.py b/django/views/generic/list.py index 00e5e5df2b..8f72b90069 100644 --- a/django/views/generic/list.py +++ b/django/views/generic/list.py @@ -64,7 +64,7 @@ class MultipleObjectMixin(ContextMixin): if page == 'last': page_number = paginator.num_pages else: - raise Http404(_("Page is not 'last', nor can it be converted to an int.")) + raise Http404(_('Page is not “last”, nor can it be converted to an int.')) try: page = paginator.page(page_number) return (paginator, page, page.object_list, page.has_other_pages()) @@ -151,7 +151,7 @@ class BaseListView(MultipleObjectMixin, View): else: is_empty = not self.object_list if is_empty: - raise Http404(_("Empty list and '%(class_name)s.allow_empty' is False.") % { + raise Http404(_('Empty list and “%(class_name)s.allow_empty” is False.') % { 'class_name': self.__class__.__name__, }) context = self.get_context_data() diff --git a/django/views/static.py b/django/views/static.py index d4888545a6..541abc66c5 100644 --- a/django/views/static.py +++ b/django/views/static.py @@ -39,7 +39,7 @@ def serve(request, path, document_root=None, show_indexes=False): return directory_index(path, fullpath) raise Http404(_("Directory indexes are not allowed here.")) if not fullpath.exists(): - raise Http404(_('"%(path)s" does not exist') % {'path': fullpath}) + raise Http404(_('“%(path)s” does not exist') % {'path': fullpath}) # Respect the If-Modified-Since header. statobj = fullpath.stat() if not was_modified_since(request.META.get('HTTP_IF_MODIFIED_SINCE'), diff --git a/django/views/templates/default_urlconf.html b/django/views/templates/default_urlconf.html index 0c25686acd..0a79ea72aa 100644 --- a/django/views/templates/default_urlconf.html +++ b/django/views/templates/default_urlconf.html @@ -382,7 +382,7 @@

    {% trans "Django Documentation" %}

    -

    {% trans "Topics, references, & how-to's" %}

    +

    {% trans 'Topics, references, & how-to’s' %}

    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 "".') + self.assertEqual(t.render(Context({})), 'Added “”.') 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, '

    Template: "admin_doc/template_detail.html"

    ', html=True) + self.assertContains(response, '

    Template: admin_doc/template_detail.html

    ', 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/" doesn't exist. Perhaps it was deleted?"""] + ['section with ID “abc/” 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, '
  3. The article "Døm ikke" was added successfully.
  4. ') + self.assertContains(response, '
  5. The article “Døm ikke” was added successfully.
  6. ') 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, - '
  7. The article "Fun & games" was added successfully.
  8. ', + '
  9. The article “Fun & games” was added successfully.
  10. ', 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, - '
  11. The cover letter "' - 'Candidate, Best" was added successfully.
  12. ' % + '
  13. The cover letter “' + 'Candidate, Best” was added successfully.
  14. ' % 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, - '
  15. The short message "' - '%s" was added successfully.
  16. ' % + '
  17. The short message “' + '%s” was added successfully.
  18. ' % (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, - '
  19. The telegram "' - 'Urgent telegram" was added successfully.
  20. ' % + '
  21. The telegram “' + 'Urgent telegram” was added successfully.
  22. ' % 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, - '
  23. The paper "' - '%s" was added successfully.
  24. ' % + '
  25. The paper “' + '%s” was added successfully.
  26. ' % (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, - '
  27. The cover letter "' - 'John Doe II" was changed successfully.
  28. ' % + '
  29. The cover letter “' + 'John Doe II” was changed successfully.
  30. ' % 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, - '
  31. The short message "' - '%s" was changed successfully.
  32. ' % + '
  33. The short message “' + '%s” was changed successfully.
  34. ' % (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, - '
  35. The telegram "' - 'Telegram without typo" was changed successfully.
  36. ' % + '
  37. The telegram “' + 'Telegram without typo” was changed successfully.
  38. ' % 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, - '
  39. The paper "' - '%s" was changed successfully.
  40. ' % + '
  41. The paper “' + '%s” was changed successfully.
  42. ' % (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, - '
  43. The user "' - '%s" was added successfully. You may edit it again below.
  44. ' + '
  45. The user “' + '%s” was added successfully. You may edit it again below.
  46. ' % (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, - '
    • Your password can't be too similar to your other personal information.
    ' + '
    • Your password can’t be too similar to your other personal information.
    ' ) @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})), '
    • field
        ' - '
      • "<script>" is not a valid value.
      • ' + '
      • “<script>” is not a valid value.
      • ' '
    ' ) 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 ' - ''Referer header' 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 'Referer' ' + '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 'same-origin' requests.', + 'HTTPS connections, or for “same-origin” requests.', status_code=403, ) self.assertContains( response, 'If you are using the <meta name="referrer" ' 'content="no-referrer"> tag or including the ' - ''Referrer-Policy: no-referrer' header, please remove them.', + '“Referrer-Policy: no-referrer” header, please remove them.', status_code=403, )