MCPcopy
hub / github.com/django/django / test_boolean_constraints

Method test_boolean_constraints

tests/backends/oracle/tests.py:65–70  ·  view source on GitHub ↗

Boolean fields have check constraints on their values.

(self)

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 3

BooleanFieldClass · 0.90
db_checkMethod · 0.45

Tested by

no test coverage detected