'Check that dumpdata honors allow_syncdb restrictions on the router'

def test_dumpdata(self):

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