def test_unit_state():
 field = UnitStateField(required=False)
 assert field.clean(str(FUZZY))
 assert field.clean(str(TRANSLATED))
 assert field.clean(str(UNTRANSLATED))
 assert field.clean(True)
 assert (not field.clean('True'))
 assert (not field.clean(False))
 assert (not field.clean('False'))

def test_unit_state ( ) : field = UnitStateField ( required = False ) assert field . clean ( str ( FUZZY ) ) assert field . clean ( str ( TRANSLATED ) ) assert field . clean ( str ( UNTRANSLATED ) ) assert field . clean ( True ) assert ( not field . clean ( 'True' ) ) assert ( not field . clean ( False ) ) assert ( not field . clean ( 'False' ) )
tests how checkbox states map to booleans .