(self)
| 170 | ) |
| 171 | |
| 172 | def test_repr(self): |
| 173 | constraint = models.CheckConstraint( |
| 174 | condition=models.Q(price__gt=models.F("discounted_price")), |
| 175 | name="price_gt_discounted_price", |
| 176 | ) |
| 177 | self.assertEqual( |
| 178 | repr(constraint), |
| 179 | "<CheckConstraint: condition=(AND: ('price__gt', F(discounted_price))) " |
| 180 | "name='price_gt_discounted_price'>", |
| 181 | ) |
| 182 | |
| 183 | def test_repr_with_violation_error_message(self): |
| 184 | constraint = models.CheckConstraint( |