Hello site
[auf_framonde.git] / eggs / Django-1.4.5-py2.7.egg / django / contrib / admindocs / tests / __init__.py
1 from django.contrib.admindocs import views
2 from django.db.models import fields as builtin_fields
3 from django.utils import unittest
4
5 import fields
6
7
8 class TestFieldType(unittest.TestCase):
9 def setUp(self):
10 pass
11
12 def test_field_name(self):
13 self.assertRaises(AttributeError,
14 views.get_readable_field_data_type, "NotAField"
15 )
16
17 def test_builtin_fields(self):
18 self.assertEqual(
19 views.get_readable_field_data_type(builtin_fields.BooleanField()),
20 u'Boolean (Either True or False)'
21 )
22
23 def test_custom_fields(self):
24 self.assertEqual(
25 views.get_readable_field_data_type(fields.CustomField()),
26 u'A custom field type'
27 )
28 self.assertEqual(
29 views.get_readable_field_data_type(fields.DescriptionLackingField()),
30 u'Field of type: DescriptionLackingField'
31 )