<s> from django . core . exceptions import ValidationError <EOL> from py . test import raises <EOL> from graphene . contrib . django . forms import GlobalIDFormField <EOL> def test_global_id_valid ( ) : <EOL> field = GlobalIDFormField ( ) <EOL> field . clean ( '<STR_LIT>' ) <EOL> def test_global_id_invalid ( ) : <EOL> field = GlobalIDFormField ( ) <EOL> with raises ( ValidationError ) : <EOL> field . clean ( '<STR_LIT>' ) <EOL> def test_global_id_none ( ) : <EOL> field = GlobalIDFormField ( ) <EOL> with raises ( ValidationError ) : <EOL> field . clean ( None ) <EOL> def test_global_id_none_optional ( ) : <EOL> field = GlobalIDFormField ( required = False ) <EOL> field . clean ( None ) <EOL> def test_global_id_bad_int ( ) : <EOL> field = GlobalIDFormField ( ) <EOL> with raises ( ValidationError ) : <EOL> field . clean ( '<STR_LIT>' ) </s>
