'Request a page that is protected with @permission_required'

def test_view_with_permissions(self):

    response = self.client.get(u'/test_client/permission_protected_view/')
    self.assertRedirects(response, u'http://testserver/accounts/login/?next=/test_client/permission_protected_view/')
    login = self.client.login(username=u'testclient', password=u'password')
    self.assertTrue(login, u'Could    not    log    in')
    response = self.client.get(u'/test_client/permission_protected_view/')
    self.assertRedirects(response, u'http://testserver/accounts/login/?next=/test_client/permission_protected_view/')
