From ca874b2fe6f768bd042b859d7eba622a68e9f9dd Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 10 Oct 2013 12:59:55 -0400 Subject: [PATCH] Fixed an undefined variable and clarified the purpose of a test. refs #4459. --- tests/serializers_regress/models.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/serializers_regress/models.py b/tests/serializers_regress/models.py index 52bc8935adb..2e9971465d7 100644 --- a/tests/serializers_regress/models.py +++ b/tests/serializers_regress/models.py @@ -244,10 +244,14 @@ class AutoNowDateTimeData(models.Model): class ModifyingSaveData(models.Model): data = models.IntegerField(null=True) - def save(self): - "A save method that modifies the data in the object" + def save(self, *args, **kwargs): + """ + A save method that modifies the data in the object. + Verifies that a user-defined save() method isn't called when objects + are deserialized (#4459). + """ self.data = 666 - super(ModifyingSaveData, self).save(raw) + super(ModifyingSaveData, self).save(*args, **kwargs) # Tests for serialization of models using inheritance. # Regression for #7202, #7350 @@ -282,4 +286,3 @@ class LengthModel(models.Model): def __len__(self): return self.data -