def testeval(obj=None, expected_result=None): assert evaluator(obj) == expected_result, "%s != %r for %s with %r" % ( evaluator(obj), expected_result, clause, obj, )
def test_mulitple_expressions(self): User = self.classes.User evaluator = compiler.process(User.id > 5, User.name == "ed") is_(evaluator(User(id=7, name="ed")), True) is_(evaluator(User(id=7, name="noted")), False) is_(evaluator(User(id=4, name="ed")), False)