コード例 #1
0
    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')
コード例 #2
0
ファイル: test_credentials.py プロジェクト: baloo/pyvac
    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')
コード例 #3
0
 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)
コード例 #4
0
 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)