Behaviour change in DRF 3.15.0 #9321
-
I have a very simple test that passes with version 3.14.0, but not with version 3.15.0. def test_journey_to_suggested_station_has_correct_creation_reason(self) -> None:
advert = AdvertFactory.create()
closest_station = self.create_station()
serializer = AdvertMutationSerializer(
advert,
data={"suggested_transportation_station": closest_station.pk},
)
serializer.is_valid(raise_exception=True)
serializer.save() The test fails because of a database constraint at the serializer.validated_data = {
'has_filled_rules': False,
'suggested_transportation_station': <TransportationStation: Marseilles Saint-Charles - FR>,
'is_nearest_station_displayable': True
} I don't understand why there is validated data that was not provided as input. For instance, even the
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I may have a hint: Maybe the default is now used as serializer default when not passed in initial data? |
Beta Was this translation helpful? Give feedback.
Yes... gnarly unexpected side-effect of #9030.
Resolved in master... we're looking at getting a patch release out ASAP, and working on improving the maintenance plans for the future.