Make sure values can be swapped in the array.
(self)
| 252 | |
| 253 | @engines_skip("sqlite") |
| 254 | def test_replace(self): |
| 255 | """ |
| 256 | Make sure values can be swapped in the array. |
| 257 | """ |
| 258 | MyTable(value=[1, 1, 1]).save().run_sync() |
| 259 | |
| 260 | MyTable.update( |
| 261 | {MyTable.value: MyTable.value.replace(1, 2)}, force=True |
| 262 | ).run_sync() |
| 263 | |
| 264 | self.assertEqual( |
| 265 | MyTable.select(MyTable.value).run_sync(), |
| 266 | [{"value": [2, 2, 2]}], |
| 267 | ) |
| 268 | |
| 269 | @sqlite_only |
| 270 | def test_replace_sqlite(self): |