MCPcopy
hub / github.com/django/django / test_show_hidden_initial

Method test_show_hidden_initial

tests/model_fields/tests.py:31–42  ·  view source on GitHub ↗

Fields with choices respect show_hidden_initial as a kwarg to formfield().

(self)

Source from the content-addressed store, hash-verified

29
30class BasicFieldTests(SimpleTestCase):
31 def test_show_hidden_initial(self):
32 """
33 Fields with choices respect show_hidden_initial as a kwarg to
34 formfield().
35 """
36 choices = [(0, 0), (1, 1)]
37 model_field = models.Field(choices=choices)
38 form_field = model_field.formfield(show_hidden_initial=True)
39 self.assertTrue(form_field.show_hidden_initial)
40
41 form_field = model_field.formfield(show_hidden_initial=False)
42 self.assertFalse(form_field.show_hidden_initial)
43
44 def test_field_repr(self):
45 """

Callers

nothing calls this directly

Calls 1

formfieldMethod · 0.95

Tested by

no test coverage detected