'Request a page that is protected with @permission_required but raises an exception'

def test_view_with_permissions_exception(self):

    response = self.client.get('/permission_protected_view_exception/')
    self.assertEqual(response.status_code, 403)
    login = self.client.login(username='testclient', password='password')
    self.assertTrue(login, 'Could    not    log    in')
    response = self.client.get('/permission_protected_view_exception/')
    self.assertEqual(response.status_code, 403)
