(self)
| 1593 | |
| 1594 | @skipUnless(connection.vendor == "mysql", "MySQL-specific workaround.") |
| 1595 | def test_exact_booleanfield(self): |
| 1596 | # MySQL ignores indexes with boolean fields unless they're compared |
| 1597 | # directly to a boolean value. |
| 1598 | product = Product.objects.create(name="Paper", qty_target=5000) |
| 1599 | Stock.objects.create(product=product, short=False, qty_available=5100) |
| 1600 | stock_1 = Stock.objects.create(product=product, short=True, qty_available=180) |
| 1601 | qs = Stock.objects.filter(short=True) |
| 1602 | self.assertSequenceEqual(qs, [stock_1]) |
| 1603 | self.assertIn( |
| 1604 | "%s = True" % connection.ops.quote_name("short"), |
| 1605 | str(qs.query), |
| 1606 | ) |
| 1607 | |
| 1608 | @skipUnless(connection.vendor == "mysql", "MySQL-specific workaround.") |
| 1609 | def test_exact_booleanfield_annotation(self): |
nothing calls this directly
no test coverage detected