1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

[1.7.x] Fixed #22979 -- Moved bug* tests

Backport of 11181a64f from master.
This commit is contained in:
Tushar Bhatia
2014-07-26 09:23:01 +08:00
committed by Tim Graham
parent 30ccb36cb9
commit df0d5ea7bc
10 changed files with 49 additions and 79 deletions

View File

@@ -406,3 +406,19 @@ class Character(models.Model):
class StumpJoke(models.Model):
most_recently_fooled = models.ForeignKey(Character, limit_choices_to=today_callable_dict, related_name="+")
has_fooled_today = models.ManyToManyField(Character, limit_choices_to=today_callable_q, related_name="+")
# Model for #639
class Photo(models.Model):
title = models.CharField(max_length=30)
image = models.FileField(storage=temp_storage, upload_to='tests')
# Support code for the tests; this keeps track of how many times save()
# gets called on each instance.
def __init__(self, *args, **kwargs):
super(Photo, self).__init__(*args, **kwargs)
self._savecount = 0
def save(self, force_insert=False, force_update=False):
super(Photo, self).save(force_insert, force_update)
self._savecount += 1