mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Fixed an undefined variable and clarified the purpose of a test.
refs #4459.
This commit is contained in:
parent
adedc31072
commit
ca874b2fe6
@ -244,10 +244,14 @@ class AutoNowDateTimeData(models.Model):
|
|||||||
class ModifyingSaveData(models.Model):
|
class ModifyingSaveData(models.Model):
|
||||||
data = models.IntegerField(null=True)
|
data = models.IntegerField(null=True)
|
||||||
|
|
||||||
def save(self):
|
def save(self, *args, **kwargs):
|
||||||
"A save method that modifies the data in the object"
|
"""
|
||||||
|
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
|
self.data = 666
|
||||||
super(ModifyingSaveData, self).save(raw)
|
super(ModifyingSaveData, self).save(*args, **kwargs)
|
||||||
|
|
||||||
# Tests for serialization of models using inheritance.
|
# Tests for serialization of models using inheritance.
|
||||||
# Regression for #7202, #7350
|
# Regression for #7202, #7350
|
||||||
@ -282,4 +286,3 @@ class LengthModel(models.Model):
|
|||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
return self.data
|
return self.data
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user