Add all_tables endpoint to allow airpal / superset perm sync. (#1614)

This commit is contained in:
Bogdan
2016-11-18 20:14:26 -05:00
committed by GitHub
parent 7a98f84890
commit 1624e7de7d
2 changed files with 35 additions and 1 deletions

View File

@@ -427,10 +427,19 @@ class CoreTests(SupersetTestCase):
def test_fetch_datasource_metadata(self):
self.login(username='admin')
url = '/superset/fetch_datasource_metadata?datasource_type=table&datasource_id=1';
url = '/superset/fetch_datasource_metadata?datasource_type=table&' \
'datasource_id=1'
resp = json.loads(self.get_resp(url))
self.assertEqual(len(resp['field_options']), 20)
def test_fetch_all_tables(self):
self.login(username='admin')
database = self.get_main_database(db.session)
url = '/superset/all_tables/{}'.format(database.id)
resp = json.loads(self.get_resp(url))
self.assertIn('tables', resp)
self.assertIn('views', resp)
if __name__ == '__main__':
unittest.main()