def test_status_bar():
 backup = views._status_bar_views
 views._status_bar_views = []
 c = make_logged_in_client()
 views.register_status_bar_view((lambda _: HttpResponse('foo', status=200)))
 views.register_status_bar_view((lambda _: HttpResponse('bar')))
 views.register_status_bar_view((lambda _: None))
 def f(r):
  raise Exception()
 views.register_status_bar_view(f)
 response = c.get('/desktop/status_bar')
 assert_equal('foobar', response.content)
 views._status_bar_views = backup

def test_status_bar ( ) : backup = views . _status_bar_views views . _status_bar_views = [ ] c = make_logged_in_client ( ) views . register_status_bar_view ( ( lambda _ : HttpResponse ( 'foo' , status = 200 ) ) ) views . register_status_bar_view ( ( lambda _ : HttpResponse ( 'bar' ) ) ) views . register_status_bar_view ( ( lambda _ : None ) ) def f ( r ) : raise Exception ( ) views . register_status_bar_view ( f ) response = c . get ( '/desktop/status_bar' ) assert_equal ( 'foobar' , response . content ) views . _status_bar_views = backup
subs out the status_bar_views registry with temporary examples .