Fixed admin_utils test failures due to translation updates.

This commit is contained in:
Tim Graham 2016-08-01 15:40:46 -04:00
parent 9af0a58756
commit 24123c3136
1 changed files with 4 additions and 3 deletions

View File

@ -59,7 +59,7 @@ class LogEntryTests(TestCase):
logentry = LogEntry.objects.filter(content_type__model__iexact='article').latest('id') logentry = LogEntry.objects.filter(content_type__model__iexact='article').latest('id')
self.assertEqual(logentry.get_change_message(), 'Changed title and hist.') self.assertEqual(logentry.get_change_message(), 'Changed title and hist.')
with translation.override('fr'): with translation.override('fr'):
self.assertEqual(logentry.get_change_message(), 'Modification de title et hist.') self.assertEqual(logentry.get_change_message(), 'Title et hist modifié(s).')
add_url = reverse('admin:admin_utils_article_add') add_url = reverse('admin:admin_utils_article_add')
post_data['title'] = 'New' post_data['title'] = 'New'
@ -117,11 +117,12 @@ class LogEntryTests(TestCase):
'Changed domain. Added article "Article object". ' 'Changed domain. Added article "Article object". '
'Changed title for article "Article object". Deleted article "Article object".' 'Changed title for article "Article object". Deleted article "Article object".'
) )
with translation.override('fr'): with translation.override('fr'):
self.assertEqual( self.assertEqual(
logentry.get_change_message(), logentry.get_change_message(),
'Modification de domain. Article « Article object » ajouté. ' "Domain modifié(s). Article « Article object » ajouté. "
'Modification de title pour l\'objet article « Article object ». Article « Article object » supprimé.' "Title modifié(s) pour l'objet article « Article object ». Article « Article object » supprimé."
) )
def test_logentry_get_edited_object(self): def test_logentry_get_edited_object(self):