test calling IN against a bind parameter. this isn't allowed on several platforms since we generate ? = ?.
(self, connection)
| 756 | |
| 757 | @testing.skip_if(["mssql"]) |
| 758 | def test_bind_in(self, connection): |
| 759 | """test calling IN against a bind parameter. |
| 760 | |
| 761 | this isn't allowed on several platforms since we |
| 762 | generate ? = ?. |
| 763 | |
| 764 | """ |
| 765 | |
| 766 | users = self.tables.users |
| 767 | |
| 768 | connection.execute(users.insert(), dict(user_id=7, user_name="jack")) |
| 769 | connection.execute(users.insert(), dict(user_id=8, user_name="fred")) |
| 770 | connection.execute(users.insert(), dict(user_id=9, user_name=None)) |
| 771 | |
| 772 | u = bindparam("search_key", type_=String) |
| 773 | |
| 774 | s = users.select().where(not_(u.in_([]))) |
| 775 | r = connection.execute(s, dict(search_key="john")).fetchall() |
| 776 | assert len(r) == 3 |
| 777 | r = connection.execute(s, dict(search_key=None)).fetchall() |
| 778 | assert len(r) == 3 |
| 779 | |
| 780 | def test_literal_in(self, connection): |
| 781 | """similar to test_bind_in but use a bind with a value.""" |