'Request a page that is protected with @permission_required'

def test_view_with_permissions(self):

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