diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-06-27 09:39:47 -0700 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-06-28 16:46:18 +0200 |
| commit | 42b9a23267f14be39b9b00958e18d5746783208e (patch) | |
| tree | f19f6a2cd70025744ad9d668a15a0c0a5ed8aac3 /tests/admin_views | |
| parent | 2b03e8e9e8205ae3a3aa128764277e70b7c30803 (diff) | |
Fixed #30400 -- Improved typography of user facing strings.
Thanks Claude Paroz for assistance with translations.
Diffstat (limited to 'tests/admin_views')
| -rw-r--r-- | tests/admin_views/admin.py | 2 | ||||
| -rw-r--r-- | tests/admin_views/test_history_view.py | 4 | ||||
| -rw-r--r-- | tests/admin_views/tests.py | 52 |
3 files changed, 29 insertions, 29 deletions
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 & games" was added successfully.</li>', + '<li class="success">The article “Fun & 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.""" |
