'Request a page that is protected with a @login_required method'

def test_view_with_method_login(self):

    response = self.client.get('/login_protected_method_view/')
    self.assertRedirects(response, '/accounts/login/?next=/login_protected_method_view/')
    login = self.client.login(username='testclient', password='password')
    self.assertTrue(login, 'Could    not    log    in')
    response = self.client.get('/login_protected_method_view/')
    self.assertEqual(response.status_code, 200)
    self.assertEqual(response.context['user'].username, 'testclient')
