On Tue, Jan 23, 2007 at 11:51:27AM -0200, Johan Dahlin wrote:
> Here is a patch I recently wrote that makes makes it easier to write code
> that constructs queries dynamically:
> 
> queries = []
> 
> if some_condition:
>   queries.append(...)

   I am going to add the following test:

def test_empty_AND():
    assert str(AND()) == "None"
    assert str(AND(True)) == "True"
    assert str(AND(1, 2)) == str(SQLOp("AND", 1, 2)) == "((1) AND (2))"

   str() is needed because AND() returns an SQLExpression that overrides
comparison. The following
   AND('x', 'y') == "foo bar"
is True! (-:

   Can you think of a better test?

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to