MCPcopy Create free account
hub / github.com/piccolo-orm/piccolo / test_not_any

Method test_not_any

tests/columns/test_array.py:117–131  ·  view source on GitHub ↗

Make sure rows can be retrieved where the array doesn't contain a certain value.

(self)

Source from the content-addressed store, hash-verified

115
116 @engines_skip("sqlite")
117 def test_not_any(self):
118 """
119 Make sure rows can be retrieved where the array doesn't contain a
120 certain value.
121 """
122 MyTable(value=[1, 2, 3]).save().run_sync()
123 MyTable(value=[4, 5, 6]).save().run_sync()
124
125 # We have to explicitly specify the type, so CockroachDB works.
126 self.assertEqual(
127 MyTable.select(MyTable.value)
128 .where(MyTable.value.not_any(QueryString("{}::INTEGER", 4)))
129 .run_sync(),
130 [{"value": [1, 2, 3]}],
131 )
132
133 @engines_skip("sqlite")
134 def test_cat(self):

Callers

nothing calls this directly

Calls 8

QueryStringClass · 0.90
saveMethod · 0.80
assertEqualMethod · 0.80
selectMethod · 0.80
not_anyMethod · 0.80
MyTableClass · 0.70
run_syncMethod · 0.45
whereMethod · 0.45

Tested by

no test coverage detected