11# -*- coding: utf-8 -*-
2- from concurrency .tests .base import AdminTestCase , SENTINEL
3- from concurrency .tests .models import ListEditableConcurrentModel , NoActionsConcurrentModel
2+ from __future__ import absolute_import , unicode_literals
43from django .contrib .admin .models import LogEntry
54from django .contrib .contenttypes .models import ContentType
5+ from django .utils .encoding import force_unicode
6+
7+ from concurrency .tests .base import AdminTestCase , SENTINEL
8+ from concurrency .tests .models import ListEditableConcurrentModel , NoActionsConcurrentModel
69
710
811class TestListEditable (AdminTestCase ):
@@ -56,7 +59,7 @@ def test_message_user(self):
5659
5760 self .assertIn ('Record with pk `1` has been modified and was not updated' ,
5861 messages )
59- self .assertIn ('1 ListEditable-ConcurrentModel was changed successfully.' ,
62+ self .assertIn ('1 %s was changed successfully.' % force_unicode ( self . TARGET . _meta . verbose_name ) ,
6063 messages )
6164
6265 def test_message_user_no_changes (self ):
@@ -71,7 +74,7 @@ def test_message_user_no_changes(self):
7174
7275 messages = map (str , list (res .context ['messages' ]))
7376
74- self .assertIn ('No ListEditable-ConcurrentModel were changed due conflict errors' ,
77+ self .assertIn ('No %s were changed due conflict errors' % force_unicode ( self . TARGET . _meta . verbose_name ) ,
7578 messages )
7679 self .assertEqual (len (messages ), 1 )
7780
0 commit comments