mirror of
https://github.com/django/django.git
synced 2025-08-17 09:10:39 +00:00
Fixed #36222 -- Fixed ExclusionConstraint validation crash on excluded fields in condition.
Signed-off-by: saJaeHyukc <wogur981208@gmail.com>
This commit is contained in:
parent
e44e8327d3
commit
c1257350ca
3 changed files with 17 additions and 0 deletions
|
@ -797,6 +797,17 @@ class ExclusionConstraintTests(PostgreSQLTestCase):
|
|||
),
|
||||
exclude={"datespan", "start", "end", "room"},
|
||||
)
|
||||
# Constraints with excluded fields in condition are ignored.
|
||||
constraint.validate(
|
||||
HotelReservation,
|
||||
HotelReservation(
|
||||
datespan=(datetimes[1].date(), datetimes[2].date()),
|
||||
start=datetimes[1],
|
||||
end=datetimes[2],
|
||||
room=room102,
|
||||
),
|
||||
exclude={"cancelled"},
|
||||
)
|
||||
|
||||
def test_range_overlaps_custom(self):
|
||||
class TsTzRange(Func):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue