'Regression test for #16039: syncdb with --database option.'

def test_syncdb_to_other_database_with_router(self):

    cts = ContentType.objects.using(u'other').filter(app_label=u'multiple_database')
    cts.delete()
    try:
        old_routers = router.routers
        router.routers = [SyncOnlyDefaultDatabaseRouter()]
        management.call_command(u'syncdb', verbosity=0, interactive=False, load_initial_data=False, database=u'other')
    finally:
        router.routers = old_routers
    self.assertEqual(cts.count(), 0)
