#NEWLINE# def test_relationships_properties_accept_builder( self ) : #NEWLINE# #INDENT# user = OratorTestUser . create ( id = 1 , email = 'john@doe.com' ) #NEWLINE# post1 = user . posts ( ) . create ( name = 'First Post' ) #NEWLINE# post2 = user . posts ( ) . create ( name = 'Second Post' ) #NEWLINE# user = OratorTestUser . with_ ( 'posts' ) . first ( ) #NEWLINE# self . assertEqual ( ( 'SELECT * FROM %(table)s WHERE %(table)s.%(user_id)s = %(marker)s ORDER BY %(name)s DESC' % { #NEWLINE# #INDENT# 'marker' : self . marker , #NEWLINE# 'table' : self . grammar ( ) . wrap ( 'test_posts' ) , #NEWLINE# 'user_id' : self . grammar ( ) . wrap ( 'user_id' ) , #NEWLINE# 'name' : self . grammar ( ) . wrap ( 'name' ) , #NEWLINE# #UNINDENT# } ) , user . post ( ) . to_sql ( ) ) #NEWLINE# user = OratorTestUser . first ( ) #NEWLINE# self . assertEqual ( ( 'SELECT * FROM %(table)s WHERE %(table)s.%(user_id)s = %(marker)s ORDER BY %(name)s DESC' % { #NEWLINE# #INDENT# 'marker' : self . marker , #NEWLINE# 'table' : self . grammar ( ) . wrap ( 'test_posts' ) , #NEWLINE# 'user_id' : self . grammar ( ) . wrap ( 'user_id' ) , #NEWLINE# 'name' : self . grammar ( ) . wrap ( 'name' ) , #NEWLINE# #UNINDENT# } ) , user . post ( ) . to_sql ( ) )