'Regression for #11286
Ensure that dumpdata honors the default manager
Dump the current contents of the database as a JSON fixture'

def test_dumpdata_uses_default_manager(self):

    management.call_command('loaddata', 'animal.xml', verbosity=0, commit=False)
    management.call_command('loaddata', 'sequence.json', verbosity=0, commit=False)
    animal = Animal(name='Platypus', latin_name='Ornithorhynchus    anatinus', count=2, weight=2.2)
    animal.save()
    stdout = StringIO()
    management.call_command('dumpdata', 'fixtures_regress.animal', format='json', stdout=stdout)
    data = stdout.getvalue()
    data = re.sub('0{6,}\\d', '', data)
    lion_json = '{"pk":    1,    "model":    "fixtures_regress.animal",    "fields":    {"count":    3,    "weight":    1.2,    "name":    "Lion",    "latin_name":    "Panthera    leo"}}'
    emu_json = '{"pk":    10,    "model":    "fixtures_regress.animal",    "fields":    {"count":    42,    "weight":    1.2,    "name":    "Emu",    "latin_name":    "Dromaius    novaehollandiae"}}'
    platypus_json = '{"pk":    %d,    "model":    "fixtures_regress.animal",    "fields":    {"count":    2,    "weight":    2.2,    "name":    "Platypus",    "latin_name":    "Ornithorhynchus    anatinus"}}'
    platypus_json = (platypus_json % animal.pk)
    self.assertEqual(len(data), len(('[%s]' % ',    '.join([lion_json, emu_json, platypus_json]))))
    self.assertTrue((lion_json in data))
    self.assertTrue((emu_json in data))
    self.assertTrue((platypus_json in data))
