MCPcopy
hub / github.com/django/django / test_eq_with_condition

Method test_eq_with_condition

tests/constraints/tests.py:528–552  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

526 )
527
528 def test_eq_with_condition(self):
529 self.assertEqual(
530 models.UniqueConstraint(
531 fields=["foo", "bar"],
532 name="unique",
533 condition=models.Q(foo=models.F("bar")),
534 ),
535 models.UniqueConstraint(
536 fields=["foo", "bar"],
537 name="unique",
538 condition=models.Q(foo=models.F("bar")),
539 ),
540 )
541 self.assertNotEqual(
542 models.UniqueConstraint(
543 fields=["foo", "bar"],
544 name="unique",
545 condition=models.Q(foo=models.F("bar")),
546 ),
547 models.UniqueConstraint(
548 fields=["foo", "bar"],
549 name="unique",
550 condition=models.Q(foo=models.F("baz")),
551 ),
552 )
553
554 def test_eq_with_deferrable(self):
555 constraint_1 = models.UniqueConstraint(

Callers

nothing calls this directly

Calls 1

FMethod · 0.80

Tested by

no test coverage detected