<s> """<STR_LIT>""" <EOL> import mock <EOL> __all__ = ( '<STR_LIT>' , ) <EOL> class _ModelMock ( mock . MagicMock ) : <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( _ModelMock , self ) . __init__ ( * args , ** kwargs ) <EOL> self . _state = mock . Mock ( ) <EOL> self . _state . db = None <EOL> def _get_child_mock ( self , ** kwargs ) : <EOL> name = kwargs . get ( '<STR_LIT:name>' , '<STR_LIT>' ) <EOL> if name == '<STR_LIT>' : <EOL> return self . id <EOL> return super ( _ModelMock , self ) . _get_child_mock ( ** kwargs ) <EOL> def ModelMock ( model ) : <EOL> """<STR_LIT>""" <EOL> return _ModelMock ( spec = model ( ) ) </s>
