'All messages for changed formsets are logged in a change message.'

def test_logentry_change_message_formsets(self):

    a2 = Article.objects.create(site=self.site, title='Title    second    article', created=datetime(2012, 3, 18, 11, 54))
    post_data = {'domain': 'example.com', 'admin_articles-TOTAL_FORMS': '5', 'admin_articles-INITIAL_FORMS': '2', 'admin_articles-MIN_NUM_FORMS': '0', 'admin_articles-MAX_NUM_FORMS': '1000', 'admin_articles-0-id': str(self.a1.pk), 'admin_articles-0-site': str(self.site.pk), 'admin_articles-0-title': 'Changed    Title', 'admin_articles-1-id': str(a2.pk), 'admin_articles-1-site': str(self.site.pk), 'admin_articles-1-title': 'Title    second    article', 'admin_articles-1-DELETE': 'on', 'admin_articles-2-site': str(self.site.pk), 'admin_articles-2-title': 'Added    article'}
    change_url = reverse('admin:admin_utils_site_change', args=[quote(self.site.pk)])
    response = self.client.post(change_url, post_data)
    self.assertRedirects(response, reverse('admin:admin_utils_site_changelist'))
    self.assertQuerysetEqual(Article.objects.filter(pk=a2.pk), [])
    logentry = LogEntry.objects.filter(content_type__model__iexact='site').latest('action_time')
    self.assertEqual(json.loads(logentry.change_message), [{'changed': {'fields': ['domain']}}, {'added': {'object': 'Added    article', 'name': 'article'}}, {'changed': {'fields': ['title'], 'object': 'Changed    Title', 'name': 'article'}}, {'deleted': {'object': 'Title    second    article', 'name': 'article'}}])
    self.assertEqual(logentry.get_change_message(), 'Changed    domain.    Added    article    "Added    article".    Changed    title    for    article    "Changed    Title".    Deleted    article    "Title    second    article".')
    with translation.override('fr'):
        self.assertEqual(logentry.get_change_message(), "Modification    de    domain.    Ajout    de    article    \xc2\xab\xc2\xa0Added    article\xc2\xa0\xc2\xbb.    Modification    de    title    pour    l'objet    article    \xc2\xab\xc2\xa0Changed    Title\xc2\xa0\xc2\xbb.    Suppression    de    article    \xc2\xab\xc2\xa0Title    second    article\xc2\xa0\xc2\xbb.")
