From 1123f4551158b7fc65d3bd88c375a4517dcd0720 Mon Sep 17 00:00:00 2001 From: Alex Couper Date: Sat, 20 Jul 2013 21:49:33 +0000 Subject: Fixed #20649 -- Allowed blank field display to be defined in the initial list of choices. --- tests/model_fields/tests.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/model_fields') diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py index 04a17df947..378e6280cc 100644 --- a/tests/model_fields/tests.py +++ b/tests/model_fields/tests.py @@ -331,6 +331,10 @@ class ValidationTest(test.TestCase): f = models.CharField(choices=[('a', 'A'), ('b', 'B')]) self.assertRaises(ValidationError, f.clean, "not a", None) + def test_charfield_get_choices_with_blank_defined(self): + f = models.CharField(choices=[('', '<><>'), ('a', 'A')]) + self.assertEqual(f.get_choices(True), [('', '<><>'), ('a', 'A')]) + def test_choices_validation_supports_named_groups(self): f = models.IntegerField( choices=(('group', ((10, 'A'), (20, 'B'))), (30, 'C'))) -- cgit v1.3