Ticket #11710: change_message_unicode_name.patch
File change_message_unicode_name.patch, 3.1 KB (added by , 15 years ago) |
---|
-
django/contrib/admin/options.py
522 522 for formset in formsets: 523 523 for added_object in formset.new_objects: 524 524 change_message.append(_('Added %(name)s "%(object)s".') 525 % {'name': added_object._meta.verbose_name,525 % {'name': force_unicode(added_object._meta.verbose_name), 526 526 'object': force_unicode(added_object)}) 527 527 for changed_object, changed_fields in formset.changed_objects: 528 528 change_message.append(_('Changed %(list)s for %(name)s "%(object)s".') 529 529 % {'list': get_text_list(changed_fields, _('and')), 530 'name': changed_object._meta.verbose_name,530 'name': force_unicode(changed_object._meta.verbose_name), 531 531 'object': force_unicode(changed_object)}) 532 532 for deleted_object in formset.deleted_objects: 533 533 change_message.append(_('Deleted %(name)s "%(object)s".') 534 % {'name': deleted_object._meta.verbose_name,534 % {'name': force_unicode(deleted_object._meta.verbose_name), 535 535 'object': force_unicode(deleted_object)}) 536 536 change_message = ' '.join(change_message) 537 537 return change_message or _('No fields changed.') -
tests/regressiontests/admin_views/models.py
54 54 return self.title 55 55 56 56 class Meta: 57 verbose_name = u'¿Chapter?' 57 # The u decorator was removed to test ticket #11710 58 verbose_name = '¿Chapter?' 58 59 59 60 class ChapterXtra1(models.Model): 60 61 chap = models.OneToOneField(Chapter, verbose_name=u'¿Chap?') -
tests/regressiontests/admin_views/tests.py
838 838 "chapter_set-5-title": u"", 839 839 "chapter_set-5-content": u"", 840 840 } 841 842 response = self.client.post('/test_admin/admin/admin_views/book/1/', post_data) 841 842 try: 843 response = self.client.post('/test_admin/admin/admin_views/book/1/', post_data) 844 except UnicodeDecodeError: 845 # For ticket #11710 846 self.fail('A unicode decode error was detected') 843 847 self.failUnlessEqual(response.status_code, 302) # redirect somewhere 844 848 845 849 def testUnicodeDelete(self):