| 1067 | def testLongUnicodeLogEntry(self): |
| 1068 | # Add an article |
| 1069 | add_dict = {'title' : ''.join([u'ä' for x in range(255)]), |
| 1070 | 'content': '<p>great article</p>', |
| 1071 | 'date_0': '2008-03-18', 'date_1': '10:54:39', |
| 1072 | 'section': 1} |
| 1073 | self.client.post('/test_admin/admin/', self.adduser_login) |
| 1074 | post = self.client.post('/test_admin/admin/admin_views/article/add/', add_dict) |
| 1075 | self.assertRedirects(post, '/test_admin/admin/') |
| 1076 | article = Article.objects.order_by('-id')[0] |
| 1077 | self.assertEqual(LogEntry.objects.all().count(), 1) |
| 1078 | logentry = LogEntry.objects.order_by('-id')[0] |
| 1079 | self.assertEqual(logentry.object_repr, ''.join([u'ä' for x in range(200)])) |
| 1080 | self.client.get('/test_admin/admin/logout/') |
| 1081 | |
| 1082 | # Delete the article |
| 1083 | delete_dict = {'post': 'yes'} |
| 1084 | self.client.post('/test_admin/admin/', self.deleteuser_login) |
| 1085 | post = self.client.post('/test_admin/admin/admin_views/article/%s/delete/' % article.id, delete_dict) |
| 1086 | self.assertRedirects(post, '/test_admin/admin/') |
| 1087 | self.assertEqual(LogEntry.objects.all().count(), 2) |
| 1088 | logentry = LogEntry.objects.order_by('-id')[0] |
| 1089 | self.assertEqual(logentry.object_repr, ''.join([u'ä' for x in range(200)])) |
| 1090 | self.client.get('/test_admin/admin/logout/') |
| 1091 | |