Skip to content

Commit

Permalink
Fixed an undefined variable and clarified the purpose of a test.
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Oct 10, 2013
1 parent adedc31 commit ca874b2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/serializers_regress/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -282,4 +286,3 @@ class LengthModel(models.Model):

def __len__(self):
return self.data

0 comments on commit ca874b2

Please sign in to comment.