test the original case for #12736
(self, json_type)
| 970 | |
| 971 | @testing.variation("json_type", ["plain", "with_variant"]) |
| 972 | def test_json_cant_contains(self, json_type): |
| 973 | """test the original case for #12736""" |
| 974 | |
| 975 | if json_type.plain: |
| 976 | type_ = JSON() |
| 977 | else: |
| 978 | type_ = JSON().with_variant(JSONB(), "postgresql") |
| 979 | |
| 980 | with expect_deprecated( |
| 981 | r"Type object .*.JSON.* does not include operator " |
| 982 | r"'contains_op' in its operator classes." |
| 983 | ): |
| 984 | self.assert_compile( |
| 985 | column("xyz", type_).contains("{'foo': 'bar'}"), |
| 986 | "xyz LIKE '%' || :xyz_1 || '%'", |
| 987 | ) |
| 988 | |
| 989 | def test_invalid_op(self): |
| 990 | with expect_deprecated( |
nothing calls this directly
no test coverage detected