(self)
| 362 | constraint_with_pk.validate(ChildModel, ChildModel(pk=1, age=1), exclude={"pk"}) |
| 363 | |
| 364 | def test_validate_fk_attname(self): |
| 365 | constraint_with_fk = models.CheckConstraint( |
| 366 | condition=models.Q(uniqueconstraintproduct_ptr_id__isnull=False), |
| 367 | name="parent_ptr_present", |
| 368 | ) |
| 369 | with self.assertRaisesMessage( |
| 370 | ValidationError, "Constraint “parent_ptr_present” is violated." |
| 371 | ): |
| 372 | constraint_with_fk.validate( |
| 373 | ChildUniqueConstraintProduct, ChildUniqueConstraintProduct() |
| 374 | ) |
| 375 | constraint_with_fk.validate( |
| 376 | ChildUniqueConstraintProduct, |
| 377 | ChildUniqueConstraintProduct(uniqueconstraintproduct_ptr_id=1), |
| 378 | ) |
| 379 | |
| 380 | @skipUnlessDBFeature("supports_json_field") |
| 381 | def test_validate_jsonfield_exact(self): |
nothing calls this directly
no test coverage detected