1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

[1.11.x] Refs #28192 -- Fixed documentation of ChoiceField choices requirement

Thanks Tim Graham for noticing the issue.
Backport of 54caca2d34 from master.
This commit is contained in:
Claude Paroz
2017-06-03 09:50:14 +02:00
parent 9a3bcaf46a
commit 81c3967e55
2 changed files with 6 additions and 1 deletions

View File

@@ -55,6 +55,10 @@ class ChoiceFieldTest(FormFieldAssertionsMixin, SimpleTestCase):
with self.assertRaisesMessage(ValidationError, msg):
f.clean('6')
def test_choicefield_choices_default(self):
f = ChoiceField()
self.assertEqual(f.choices, [])
def test_choicefield_callable(self):
def choices():
return [('J', 'John'), ('P', 'Paul')]