Exemplo n.º 1
0
    def run(self):
        if len(self.args) < 2:
            self.parser.error("Specify USERNAME and EMAIL")
        elif len(self.args) > 2:
            self.parser.error("Invalid argument")

        username = self.args[0]
        email = self.args[1]

        try:
            users.usermod(username, email)
            db.session.commit()
        except Exception, e:
            if self.options.debug: raise
            print e
            exit(1)
Exemplo n.º 2
0
    def run(self):
        if len(self.args) < 2:
            self.parser.error("Specify USERNAME and EMAIL")
        elif len(self.args) > 2:
            self.parser.error("Invalid argument")

        username = self.args[0]
        email = self.args[1]

        try:
            users.usermod(username, email)
            db.session.commit()
        except Exception, e:
            if self.options.debug:
                raise
            print e
            exit(1)
Exemplo n.º 3
0
    def test_usermod(self):
        gideon = users.create("gideon", "secret", "*****@*****.**")
        self.assertEquals(gideon.email, "*****@*****.**") # original email

        users.usermod("gideon", "*****@*****.**")
        self.assertEquals(gideon.email, "*****@*****.**") # new email