Boolean fields have check constraints on their values.
(self)
| 63 | self.assertEqual(cursor.fetchone()[0], 1) |
| 64 | |
| 65 | def test_boolean_constraints(self): |
| 66 | """Boolean fields have check constraints on their values.""" |
| 67 | for field in (BooleanField(), BooleanField(null=True)): |
| 68 | with self.subTest(field=field): |
| 69 | field.set_attributes_from_name("is_nice") |
| 70 | self.assertIn('"IS_NICE" IN (0,1)', field.db_check(connection)) |
| 71 | |
| 72 | @mock.patch.object( |
| 73 | connection, |
nothing calls this directly
no test coverage detected