#NEWLINE# def test_mine_on_requests_as_watcher( self ) : #NEWLINE# #INDENT# request = dict ( self . basic_request ) #NEWLINE# request [ 'watchers' ] = 'watcher1' #NEWLINE# push_contents = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# section_id = [ ] #NEWLINE# for section in self . accepting_push_sections : #NEWLINE# #INDENT# push_contents [ section ] = [ request , found_mockreq . basic_request ] #NEWLINE# section_id . append ( ( '%s-items' % section ) ) #NEWLINE# #UNINDENT# kwargs = dict ( self . basic_kwargs ) #NEWLINE# kwargs [ 'push_contents' ] = push_contents #NEWLINE# kwargs [ 'current_user' ] = 'watcher1' #NEWLINE# kwargs [ 'pickme_orders' ] = [ 'urgent' ] #NEWLINE# with self . no_ui_modules ( ) : #NEWLINE# #INDENT# tree = self . render_etree ( self . push_status_page , push_info = self . basic_push , ** kwargs ) #NEWLINE# #UNINDENT# found_li = [ ] #NEWLINE# found_mockreq = [ ] #NEWLINE# for mockreq in tree . iter ( 'mock' ) : #NEWLINE# #INDENT# if ( 'class' in mockreq . getparent ( ) . attrib ) : #NEWLINE# #INDENT# T . assert_equal ( 'mine' , mockreq . getparent ( ) . attrib [ 'class' ] ) #NEWLINE# found_li . append ( mockreq ) #NEWLINE# #UNINDENT# found_mockreq . append ( mockreq ) #NEWLINE# #UNINDENT# T . assert_equal ( 5 , len ( found_li ) ) #NEWLINE# T . assert_equal ( 10 , len ( found_mockreq ) )