test calling IN against a bind parameter. this isn't allowed on several platforms since we generate ? = ?.
(self, connection)
| 824 | |
| 825 | @testing.skip_if(["mssql"]) |
| 826 | def test_bind_in(self, connection): |
| 827 | """test calling IN against a bind parameter. |
| 828 | |
| 829 | this isn't allowed on several platforms since we |
| 830 | generate ? = ?. |
| 831 | |
| 832 | """ |
| 833 | |
| 834 | users = self.tables.users |
| 835 | |
| 836 | connection.execute(users.insert(), dict(user_id=7, user_name="jack")) |
| 837 | connection.execute(users.insert(), dict(user_id=8, user_name="fred")) |
| 838 | connection.execute(users.insert(), dict(user_id=9, user_name=None)) |
| 839 | |
| 840 | u = bindparam("search_key", type_=String) |
| 841 | |
| 842 | s = users.select().where(not_(u.in_([]))) |
| 843 | r = connection.execute(s, dict(search_key="john")).fetchall() |
| 844 | assert len(r) == 3 |
| 845 | r = connection.execute(s, dict(search_key=None)).fetchall() |
| 846 | assert len(r) == 3 |
| 847 | |
| 848 | def test_literal_in(self, connection): |
| 849 | """similar to test_bind_in but use a bind with a value.""" |