'Assert that a given object is a view.  That is, it is callable, and
takes a request argument.  Note: while technically, the request argument
could take any name, this assertion requires the argument to be named
`request`.  This is good practice.  You should do it anyway.'

def assert_is_view(self, view_candidate):

    _msg_base = u'{view}    is    not    a    view:    {reason}'
    msg_not_callable = _msg_base.format(view=view_candidate, reason=u'it    is    not    callable')
    msg_no_request = _msg_base.format(view=view_candidate, reason=u'it    has    no    request    argument')
    self.assertTrue(hasattr(view_candidate, '__call__'), msg_not_callable)
    args = view_candidate.func_code.co_varnames
    self.assertTrue(args, msg_no_request)
    self.assertEqual(args[0], 'request')
