          (4, 'Fourth'),
      ]
  
      def test_choices(self):
          """
          Make sure a value for choices works as expected.
          """
          f = serializers.ChoiceField(choices=self.CHOICES)
          value = self.CHOICES[0][0]
 
</s> remove         # Allow either single or paired choices style:
        # choices = [1, 2, 3]
        # choices = [(1, 'First'), (2, 'Second'), (3, 'Third')]
        pairs = [
            isinstance(item, (list, tuple)) and len(item) == 2
            for item in choices
        ]
        if all(pairs):
            self.choices = OrderedDict([(key, display_value) for key, display_value in choices])
        else:
            self.choices = OrderedDict([(item, item) for item in choices])
 </s> add         flat_choices = [self.flatten_choice(c) for c in choices]
        self.choices = OrderedDict(itertools.chain(*flat_choices))
    MIXED_CHOICES = [
        ('Category', (
            (1, 'First'),
            (2, 'Second'),
        )),
        3,
        (4, 'Fourth'),
    ]

          (4, 'Fourth'),
      ]
  
    MIXED_CHOICES = [
        ('Category', (
            (1, 'First'),
            (2, 'Second'),
        )),
        3,
        (4, 'Fourth'),
    ]

      def test_choices(self):
          """
          Make sure a value for choices works as expected.
          """
          f = serializers.ChoiceField(choices=self.CHOICES)
          value = self.CHOICES[0][0]
keep keep add keep keep keep keep keep keep
 Add support for grouped choices.

This also adds support for mixing single and paired choices:
```
[
    ('poor', 'Poor quality'),
    'medium',
    ('good', 'Good quality'),
]
``` 
tests/test_validation.py