'login_required works on a simple view wrapped in a login_required
decorator.'

def testLoginRequired(self, view_url='/login_required/', login_url=None):

    if (login_url is None):
        login_url = settings.LOGIN_URL
    response = self.client.get(view_url)
    self.assertEqual(response.status_code, 302)
    self.assertIn(login_url, response.url)
    self.login()
    response = self.client.get(view_url)
    self.assertEqual(response.status_code, 200)
