Fixed #18240 -- Made admindocs tests pass even when language is not en.
Thanks miguel.ventura@gmail.com for the report and the patch.
This commit is contained in:
parent
d5a277ba4d
commit
eba4197c71
|
@ -1,6 +1,7 @@
|
|||
from django.contrib.admindocs import views
|
||||
from django.db.models import fields as builtin_fields
|
||||
from django.utils import unittest
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
import fields
|
||||
|
||||
|
@ -17,15 +18,17 @@ class TestFieldType(unittest.TestCase):
|
|||
def test_builtin_fields(self):
|
||||
self.assertEqual(
|
||||
views.get_readable_field_data_type(builtin_fields.BooleanField()),
|
||||
u'Boolean (Either True or False)'
|
||||
_(u'Boolean (Either True or False)')
|
||||
)
|
||||
|
||||
def test_custom_fields(self):
|
||||
self.assertEqual(
|
||||
views.get_readable_field_data_type(fields.CustomField()),
|
||||
u'A custom field type'
|
||||
_(u'A custom field type')
|
||||
)
|
||||
self.assertEqual(
|
||||
views.get_readable_field_data_type(fields.DescriptionLackingField()),
|
||||
u'Field of type: DescriptionLackingField'
|
||||
_(u'Field of type: %(field_type)s') % {
|
||||
'field_type': 'DescriptionLackingField'
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue