def test_passwd(self):
        gideon = users.create("gideon", "secret", "*****@*****.**")
        self.assertTrue(gideon.password_matches("secret")) # original passwd

        users.passwd("gideon", "newsecret")
        self.assertTrue(gideon.password_matches("newsecret")) # new passwd

        gideon2 = users.getuser("gideon")
        self.assertTrue(gideon2.password_matches("newsecret")) # new passwd
Example #2
0
    def run(self):
        if len(self.args) != 1:
            self.parser.error("Invalid argument")

        try:
            users.passwd(self.args[0], None)
            db.session.commit()
        except Exception, e:
            if self.options.debug: raise
            print e
            exit(1)
Example #3
0
    def run(self):
        if len(self.args) != 1:
            self.parser.error("Invalid argument")

        try:
            users.passwd(self.args[0], None)
            db.session.commit()
        except Exception, e:
            if self.options.debug:
                raise
            print e
            exit(1)