1
0
mirror of https://github.com/django/django.git synced 2025-10-28 08:06:09 +00:00

Proposed fix for #18162.

This commit is contained in:
Tomek Paczkowski
2013-02-23 19:01:38 +01:00
parent f3ae67a62f
commit b6f4a92ff4
2 changed files with 15 additions and 2 deletions

View File

@@ -73,6 +73,16 @@ class BasicFieldTests(test.TestCase):
self.assertEqual(m._meta.get_field('id').verbose_name, 'verbose pk')
def test_formclass_with_choices(self):
# regression for 18162
class CustomChoiceField(forms.TypedChoiceField):
pass
choices = [('a@b.cc', 'a@b.cc'), ('b@b.cc', 'b@b.cc')]
field = models.CharField(choices=choices)
klass = CustomChoiceField
self.assertIsInstance(field.formfield(form_class=klass), klass)
class DecimalFieldTests(test.TestCase):
def test_to_python(self):
f = models.DecimalField(max_digits=4, decimal_places=2)