summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2009-06-09 13:14:40 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2009-06-09 13:14:40 +0000
commitd3bd3203f9d202ed781d204f283459df87139bc5 (patch)
tree95dafa1794a0cb7dfb5beb85db6f0ced5c0b2e1b /tests
parent64be8f29d5a9892047ac40d9306015ac402b1a39 (diff)
Fixed #11286 -- Ensured that dumpdata uses the default manager, rather than always using the manager called `objects`. Thanks to Marc Remolt for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10967 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/fixtures_regress/models.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/regressiontests/fixtures_regress/models.py b/tests/regressiontests/fixtures_regress/models.py
index 621c80c15f..16a9fc4fc5 100644
--- a/tests/regressiontests/fixtures_regress/models.py
+++ b/tests/regressiontests/fixtures_regress/models.py
@@ -9,6 +9,9 @@ class Animal(models.Model):
count = models.IntegerField()
weight = models.FloatField()
+ # use a non-default name for the default manager
+ specimens = models.Manager()
+
def __unicode__(self):
return self.common_name
@@ -161,4 +164,10 @@ Weight = 1.2 (<type 'float'>)
>>> models.signals.pre_save.disconnect(animal_pre_save_check)
+###############################################
+# Regression for #11286 -- Ensure that dumpdata honors the default manager
+# Dump the current contents of the database as a JSON fixture
+>>> management.call_command('dumpdata', 'fixtures_regress.animal', format='json')
+[{"pk": 1, "model": "fixtures_regress.animal", "fields": {"count": 3, "weight": 1.2, "name": "Lion", "latin_name": "Panthera leo"}}, {"pk": 2, "model": "fixtures_regress.animal", "fields": {"count": 2, "weight": 2.29..., "name": "Platypus", "latin_name": "Ornithorhynchus anatinus"}}, {"pk": 10, "model": "fixtures_regress.animal", "fields": {"count": 42, "weight": 1.2, "name": "Emu", "latin_name": "Dromaius novaehollandiae"}}]
+
"""}