def test_login_unknown(self): from pyvac.views.credentials import Login request = self.create_request() view = Login(request)() self.assertEqual(set(view.keys()), set(['pyvac', 'csrf_token', 'came_from'])) self.assertEqual(view['came_from'], 'http://pyvac.example.net')
def test_login_unknown(self): from pyvac.views.credentials import Login request = self.create_request() view = Login(request)() self.assertEqual(set(view.keys()), set(['pyvac', 'csrf_token', 'came_from'])) self.assertEqual(view['came_from'], u'http://pyvac.example.net')
def test_login_ok(self): from pyvac.views.credentials import Login request = self.create_request({'submit': u'1', 'login': self.account_login, 'password': u'secret', }) view = Login(request)() self.assertIsRedirect(view)
def test_login_sudo_nope_ok(self): from pyvac.views.credentials import Login request = self.create_request({'submit': u'1', 'login': u'jdoe', 'password': u'changeme', }) view = Login(request)() self.assertFalse(view.location.endswith('/sudo')) self.assertIsRedirect(view)