<s> from expects import * <EOL> from booby import models , fields , encoders <EOL> IRRELEVANT_NAME = '<STR_LIT>' <EOL> IRRELEVANT_EMAIL = '<STR_LIT>' <EOL> class TestEncode ( object ) : <EOL> def test_should_return_encoded_model ( self ) : <EOL> class User ( models . Model ) : <EOL> name = fields . Field ( ) <EOL> email = fields . Field ( ) <EOL> user = User ( name = IRRELEVANT_NAME , email = IRRELEVANT_EMAIL ) <EOL> result = self . encoder ( user ) <EOL> expect ( result ) . to ( equal ( user . encode ( ) ) ) <EOL> def test_should_return_none_if_value_is_none ( self ) : <EOL> result = self . encoder ( None ) <EOL> expect ( result ) . to ( be_none ) <EOL> def setup ( self ) : <EOL> self . encoder = encoders . Model ( ) </s>
