#NEWLINE# def _test_dropdown_action_hook( self , template_tag_name , hook_cls ) : #NEWLINE# #INDENT# action = { #NEWLINE# #INDENT# 'id' : 'test-menu' , #NEWLINE# 'label' : 'Test Menu' , #NEWLINE# 'items' : [ { #NEWLINE# #INDENT# 'id' : 'test-action' , #NEWLINE# 'label' : 'Test Action' , #NEWLINE# 'url' : 'foo-url' , #NEWLINE# 'image' : 'test-image' , #NEWLINE# 'image_width' : 42 , #NEWLINE# 'image_height' : 42 , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# hook = hook_cls ( extension = self . extension , actions = [ action ] ) #NEWLINE# context = Context ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# entries = hook . get_actions ( context ) #NEWLINE# self . assertEqual ( len ( entries ) , 1 ) #NEWLINE# self . assertEqual ( entries [ 0 ] , action ) #NEWLINE# t = Template ( ( ( '{% load rb_extensions %}{% ' + template_tag_name ) + ' %}' ) ) #NEWLINE# content = t . render ( context ) . strip ( ) #NEWLINE# self . assertIn ( ( 'id="%s"' % action [ 'id' ] ) , content ) #NEWLINE# self . assertIn ( ( '>%s &#9662;' % action [ 'label' ] ) , content ) #NEWLINE# self . assertIn ( self . _build_action_template ( action [ 'items' ] [ 0 ] ) , content )