change the in_ API to accept a sequence or a selectable [ticket:750]

This commit is contained in:
Ants Aasma
2007-10-16 22:57:05 +00:00
parent cc0e7c796f
commit 6bbc7dd157
19 changed files with 119 additions and 94 deletions
+2 -2
View File
@@ -176,13 +176,13 @@ class ZooMarkTest(testing.AssertMixin):
# In operator (containedby)
assert len(fulltable(Animal.select(Animal.c.Species.like('%pede%')))) == 2
assert len(fulltable(Animal.select(Animal.c.Species.in_('Lion', 'Tiger', 'Bear')))) == 3
assert len(fulltable(Animal.select(Animal.c.Species.in_(['Lion', 'Tiger', 'Bear'])))) == 3
# Try In with cell references
class thing(object): pass
pet, pet2 = thing(), thing()
pet.Name, pet2.Name = 'Slug', 'Ostrich'
assert len(fulltable(Animal.select(Animal.c.Species.in_(pet.Name, pet2.Name)))) == 2
assert len(fulltable(Animal.select(Animal.c.Species.in_([pet.Name, pet2.Name])))) == 2
# logic and other functions
assert len(fulltable(Animal.select(Animal.c.Species.like('Slug')))) == 1