'This test would fail if permission is checked **after** view is
actually resolved.'

def test_permission_required_as_list(self):

    global TestView
    class SecretView(TestView, ):
        on_permission_check_fail = mock.Mock()
    request = self.factory.get(u'/')
    request.user = self.user
    request.user.add_obj_perm(u'change_post', self.post)
    SecretView.permission_required = [u'testapp.change_post', u'testapp.add_post']
    view = SecretView.as_view(object=self.post)
    response = view(request)
    self.assertEqual(response.status_code, 302)
    SecretView.on_permission_check_fail.assert_called_once_with(request, response, obj=self.post)
    request.user.add_obj_perm(u'add_post', self.post)
    with self.assertRaises(DatabaseRemovedError):
        view(request)
