Exemplo n.º 1
0
    def test_hashed_password_empty(self, root):
        from kotti.views.users import UserManageFormView

        user = Mock(password=u'before')
        request = DummyRequest()
        view = UserManageFormView(user, request)
        appstruct = {'password': u''}
        view.save_success(appstruct)
        assert user.password == u"before"
Exemplo n.º 2
0
    def test_hashed_password_empty(self, root):
        from kotti.views.users import UserManageFormView

        user = Mock(password='******')
        request = DummyRequest()
        view = UserManageFormView(user, request)
        appstruct = {'password': ''}
        view.save_success(appstruct)
        assert user.password == "before"
Exemplo n.º 3
0
    def test_hashed_password_save(self, root):
        from kotti.views.users import UserManageFormView

        user = Mock()
        request = DummyRequest()
        view = UserManageFormView(user, request)
        appstruct = {'password': u'foo'}
        view.save_success(appstruct)
        assert user.password.startswith(u'$2a$10$')
Exemplo n.º 4
0
    def test_hashed_password_save(self, root):
        from kotti.views.users import UserManageFormView

        user = Mock()
        request = DummyRequest()
        view = UserManageFormView(user, request)
        appstruct = {'password': '******'}
        view.save_success(appstruct)
        assert user.password.startswith('$2a$10$')