summaryrefslogtreecommitdiff
path: root/tests/model_fields
diff options
context:
space:
mode:
Diffstat (limited to 'tests/model_fields')
-rw-r--r--tests/model_fields/tests.py4
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')))