def test_get_max_length_max_length_is_none_and_choices_is_not_empty(self): choices = [ ('key1', 'value1'), ('key2', 'value2'), ('key3', 'value3'), ] self.assertEqual(get_max_length(choices, None), 14)
def test_get_max_length_max_length_is_none_and_choices_is_empty(self): self.assertEqual(get_max_length([], None), 200)
def test_get_max_length_max_length_is_not_none(self): self.assertEqual(get_max_length([], 5), 5)
def test_get_max_length_max_length_is_none_and_choices_is_not_empty(self): choices = [("key1", "value1"), ("key2", "value2"), ("key3", "value3")] self.assertEqual(get_max_length(choices, None), 14)