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

def test_view_with_method_login(self):

    response = self.client.get(u'/test_client/login_protected_method_view/')
    self.assertRedirects(response, u'http://testserver/accounts/login/?next=/test_client/login_protected_method_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/login_protected_method_view/')
    self.assertEqual(response.status_code, 200)
    self.assertEqual(response.context[u'user'].username, u'testclient')
