diff options
| author | Alex Couper <alex.couper@glassesdirect.com> | 2013-07-20 21:49:33 +0000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-07-31 14:12:03 -0400 |
| commit | 1123f4551158b7fc65d3bd88c375a4517dcd0720 (patch) | |
| tree | cfded236931c3360205bf35351d81c75a78ef743 /tests/model_fields | |
| parent | a1889397a9f0e6a35189de455098b4c70923e561 (diff) | |
Fixed #20649 -- Allowed blank field display to be defined in the initial list of choices.
Diffstat (limited to 'tests/model_fields')
| -rw-r--r-- | tests/model_fields/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
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'))) |
