<s> """<STR_LIT>""" <EOL> from django . test import TestCase <EOL> from django . db import models <EOL> from django_any import any_field <EOL> class AttrChoices ( TestCase ) : <EOL> def test_one_case_selection ( self ) : <EOL> """<STR_LIT>""" <EOL> field = models . BooleanField ( choices = [ <EOL> ( False , '<STR_LIT>' ) ] ) <EOL> result = any_field ( field ) <EOL> self . assertEqual ( bool , type ( result ) ) <EOL> self . assertEqual ( False , result ) <EOL> def test_choices_named_groups_support ( self ) : <EOL> """<STR_LIT>""" <EOL> MEDIA_CHOICES = ( <EOL> ( '<STR_LIT>' , ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) ) , <EOL> ( '<STR_LIT>' , ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> media = models . CharField ( max_length = <NUM_LIT> , choices = MEDIA_CHOICES ) <EOL> result = any_field ( media ) <EOL> self . assertTrue ( result in [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) </s>
