mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-06-05 07:17:06 -04:00
change the in_ API to accept a sequence or a selectable [ticket:750]
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user