| 534 | |
| 535 | @engines_skip("cockroach") |
| 536 | def test_operators(self): |
| 537 | for test_case in TEST_CASES: |
| 538 | print(test_case.description) |
| 539 | |
| 540 | # Create the initial data in the database. |
| 541 | instance = MyTable() |
| 542 | setattr(instance, test_case.column._meta.name, test_case.initial) |
| 543 | instance.save().run_sync() |
| 544 | |
| 545 | # Apply the update. |
| 546 | MyTable.update( |
| 547 | {test_case.column: test_case.querystring}, force=True |
| 548 | ).run_sync() |
| 549 | |
| 550 | # Make sure the value returned from the database is correct. |
| 551 | new_value = getattr( |
| 552 | MyTable.objects().first().run_sync(), |
| 553 | test_case.column._meta.name, |
| 554 | ) |
| 555 | |
| 556 | self.assertEqual( |
| 557 | new_value, test_case.expected, msg=test_case.description |
| 558 | ) |
| 559 | |
| 560 | # Clean up |
| 561 | MyTable.delete(force=True).run_sync() |
| 562 | |
| 563 | @sqlite_only |
| 564 | def test_edge_cases(self): |