def check_password(self, raw_value):
        match = self.password_expr.match(self.password)
        if match is None:
            return False
        if isinstance(raw_value, unicode):
            raw_value = raw_value.encode("utf-8")
        scheme = match.group(1)
        val2 = match.group(2)
        hasher = get_password_hasher(scheme)
        return hasher().verify(raw_value, val2)
Compare raw_value to current password.
dataset/ETHPy150Open tonioo/modoboa/modoboa/core/models.py/User.check_password