'Check that dumpdata honors allow_syncdb restrictions on the router'

def test_dumpdata(self):

    User.objects.create_user('alice', 'alice@example.com')
    User.objects.db_manager('default').create_user('bob', 'bob@example.com')
    new_io = StringIO()
    management.call_command('dumpdata', 'auth', format='json', database='default', stdout=new_io)
    command_output = new_io.getvalue().strip()
    self.assertEqual(command_output, '[]')
    new_io = StringIO()
    management.call_command('dumpdata', 'auth', format='json', database='other', stdout=new_io)
    command_output = new_io.getvalue().strip()
    self.assertTrue(('"email":    "alice@example.com",' in command_output))
