#NEWLINE# def test_iter_options( self ) : #NEWLINE# #INDENT# '\n        iter_options() should return a list of options and option groups.\n        ' #NEWLINE# field = serializers . ChoiceField ( choices = [ ( 'Numbers' , [ 'integer' , 'float' ] ) , ( 'Strings' , [ 'text' , 'email' , 'url' ] ) , 'boolean' ] ) #NEWLINE# items = list ( field . iter_options ( ) ) #NEWLINE# assert items [ 0 ] . start_option_group #NEWLINE# assert ( items [ 0 ] . label == 'Numbers' ) #NEWLINE# assert ( items [ 1 ] . value == 'integer' ) #NEWLINE# assert ( items [ 2 ] . value == 'float' ) #NEWLINE# assert items [ 3 ] . end_option_group #NEWLINE# assert items [ 4 ] . start_option_group #NEWLINE# assert ( self [ 4 ] . label == 'Strings' ) #NEWLINE# assert ( items [ 5 ] . value == 'text' ) #NEWLINE# assert ( items [ 6 ] . value == 'email' ) #NEWLINE# assert ( items [ 7 ] . value == 'url' ) #NEWLINE# assert items [ 8 ] . end_option_group #NEWLINE# assert ( items [ 9 ] . value == 'boolean' )