#NEWLINE# def test_youtube_in_post( self ) : #NEWLINE# #INDENT# 'Verify youtube video embedding.' #NEWLINE# u = UserFactory ( ) #NEWLINE# t = ThreadFactory ( ) #NEWLINE# self . client . login ( username = u . username , password = 'testpass' ) #NEWLINE# response = post ( self . client , 'forums.reply' , { #NEWLINE# #INDENT# 'content' : '[[V:http://www.youtube.com/watch?v=oHg5SJYRHA0]]' , #NEWLINE# #UNINDENT# } , args = [ t . forum . slug , t . id ] ) #NEWLINE# doc = pq ( response . content ) #NEWLINE# assert doc ( 'iframe' ) [ 0 ] . attrib [ 'src' ] . startswith ( '//www.youtube.com/embed/oHg5SJYRHA0' )