<s> from __future__ import unicode_literals <EOL> import unittest <EOL> from django . contrib . admindocs import views <EOL> from django . db import models <EOL> from django . db . models import fields <EOL> from django . utils . translation import ugettext as _ <EOL> class CustomField ( models . Field ) : <EOL> description = "<STR_LIT>" <EOL> class DescriptionLackingField ( models . Field ) : <EOL> pass <EOL> class TestFieldType ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> pass <EOL> def test_field_name ( self ) : <EOL> self . assertRaises ( <EOL> AttributeError , <EOL> views . get_readable_field_data_type , "<STR_LIT>" <EOL> ) <EOL> def test_builtin_fields ( self ) : <EOL> self . assertEqual ( <EOL> views . get_readable_field_data_type ( fields . BooleanField ( ) ) , <EOL> _ ( '<STR_LIT>' ) <EOL> ) <EOL> def test_custom_fields ( self ) : <EOL> self . assertEqual ( <EOL> views . get_readable_field_data_type ( CustomField ( ) ) , <EOL> '<STR_LIT>' <EOL> ) <EOL> self . assertEqual ( <EOL> views . get_readable_field_data_type ( DescriptionLackingField ( ) ) , <EOL> _ ( '<STR_LIT>' ) % { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> ) </s>
