MCPcopy
hub / github.com/django/django / test_choices

Method test_choices

tests/utils_tests/test_choices.py:152–163  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

150 self.assertEqual(normalize_choices(choices), [])
151
152 def test_choices(self):
153 class Medal(TextChoices):
154 GOLD = "GOLD", _("Gold")
155 SILVER = "SILVER", _("Silver")
156 BRONZE = "BRONZE", _("Bronze")
157
158 expected = [
159 ("GOLD", _("Gold")),
160 ("SILVER", _("Silver")),
161 ("BRONZE", _("Bronze")),
162 ]
163 self.assertEqual(normalize_choices(Medal), expected)
164
165 def test_callable(self):
166 def get_choices():

Callers

nothing calls this directly

Calls 1

normalize_choicesFunction · 0.90

Tested by

no test coverage detected