#NEWLINE# def test_implicit_parameters_default( ) : #NEWLINE# #INDENT# class app ( morepath . App ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# @ app . path ( path = '' ) #NEWLINE# class Root ( object ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# class Model ( object ) : #NEWLINE# #INDENT# def __init__( self , id ) : #NEWLINE# #INDENT# self . id = id #NEWLINE# #UNINDENT# #UNINDENT# @ app . path ( model = Model , path = 'foo' ) #NEWLINE# def get_model( id = 'default' ) : #NEWLINE# #INDENT# return Model ( id ) #NEWLINE# #UNINDENT# @ app . view ( model = Model ) #NEWLINE# def default( self , request ) : #NEWLINE# #INDENT# return ( 'The view for model: %s' % self . id ) #NEWLINE# #UNINDENT# @ app . view ( model = Model , name = 'link' ) #NEWLINE# def link( self , request ) : #NEWLINE# #INDENT# return request . link ( self ) #NEWLINE# #UNINDENT# c = Client ( app ( ) ) #NEWLINE# response = c . get ( '/foo' ) #NEWLINE# assert ( response . body == b'The view for model: default' ) #NEWLINE# response = c . get ( '/foo?id=bar' ) #NEWLINE# assert ( response . body == b'The view for model: bar' ) #NEWLINE# response = c . get ( '/foo/link' ) #NEWLINE# assert ( response . body == b'http://localhost/foo?id=default' ) #NEWLINE# response = c . get ( '/foo/link?id=bar' ) #NEWLINE# assert ( response . body == b'http://localhost/foo?id=bar' )