Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Modified admindocs tests to work with unittest2 discovery.

  • Loading branch information...
commit 7fd1571b2e7f75c2e456de89d8c5bd805b16c1a9 1 parent 8ce4637
Preston Timmons authored April 02, 2013 carljm committed April 02, 2013
37  django/contrib/admindocs/tests/__init__.py
... ...
@@ -1,36 +1 @@
1  
-from __future__ import absolute_import, unicode_literals
2  
-
3  
-from django.contrib.admindocs import views
4  
-from django.db.models import fields as builtin_fields
5  
-from django.utils import unittest
6  
-from django.utils.translation import ugettext as _
7  
-
8  
-from . import fields
9  
-
10  
-
11  
-class TestFieldType(unittest.TestCase):
12  
-    def setUp(self):
13  
-        pass
14  
-
15  
-    def test_field_name(self):
16  
-        self.assertRaises(AttributeError,
17  
-            views.get_readable_field_data_type, "NotAField"
18  
-        )
19  
-
20  
-    def test_builtin_fields(self):
21  
-        self.assertEqual(
22  
-            views.get_readable_field_data_type(builtin_fields.BooleanField()),
23  
-            _('Boolean (Either True or False)')
24  
-        )
25  
-
26  
-    def test_custom_fields(self):
27  
-        self.assertEqual(
28  
-            views.get_readable_field_data_type(fields.CustomField()),
29  
-            'A custom field type'
30  
-        )
31  
-        self.assertEqual(
32  
-            views.get_readable_field_data_type(fields.DescriptionLackingField()),
33  
-            _('Field of type: %(field_type)s') % {
34  
-                'field_type': 'DescriptionLackingField'
35  
-            }
36  
-        )
  1
+from .test_fields import TestFieldType
7  django/contrib/admindocs/tests/fields.py
... ...
@@ -1,7 +0,0 @@
1  
-from django.db import models
2  
-
3  
-class CustomField(models.Field):
4  
-    description = "A custom field type"
5  
-
6  
-class DescriptionLackingField(models.Field):
7  
-    pass
42  django/contrib/admindocs/tests/test_fields.py
... ...
@@ -0,0 +1,42 @@
  1
+from __future__ import absolute_import, unicode_literals
  2
+
  3
+from django.contrib.admindocs import views
  4
+from django.db import models
  5
+from django.db.models import fields
  6
+from django.utils import unittest
  7
+from django.utils.translation import ugettext as _
  8
+
  9
+
  10
+class CustomField(models.Field):
  11
+    description = "A custom field type"
  12
+
  13
+class DescriptionLackingField(models.Field):
  14
+    pass
  15
+
  16
+
  17
+class TestFieldType(unittest.TestCase):
  18
+    def setUp(self):
  19
+        pass
  20
+
  21
+    def test_field_name(self):
  22
+        self.assertRaises(AttributeError,
  23
+            views.get_readable_field_data_type, "NotAField"
  24
+        )
  25
+
  26
+    def test_builtin_fields(self):
  27
+        self.assertEqual(
  28
+            views.get_readable_field_data_type(fields.BooleanField()),
  29
+            _('Boolean (Either True or False)')
  30
+        )
  31
+
  32
+    def test_custom_fields(self):
  33
+        self.assertEqual(
  34
+            views.get_readable_field_data_type(CustomField()),
  35
+            'A custom field type'
  36
+        )
  37
+        self.assertEqual(
  38
+            views.get_readable_field_data_type(DescriptionLackingField()),
  39
+            _('Field of type: %(field_type)s') % {
  40
+                'field_type': 'DescriptionLackingField'
  41
+            }
  42
+        )

0 notes on commit 7fd1571

Please sign in to comment.
Something went wrong with that request. Please try again.