mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
Moving get_main_db out of tests and into superset utils (#5864)
This commit is contained in:
committed by
John Bodley
parent
c82cea3c8d
commit
657993d609
@@ -7,20 +7,9 @@ from __future__ import unicode_literals
|
||||
import json
|
||||
from os import path
|
||||
|
||||
from superset import db
|
||||
from superset.models import core as models
|
||||
|
||||
FIXTURES_DIR = 'tests/fixtures'
|
||||
|
||||
|
||||
def load_fixture(fixture_file_name):
|
||||
with open(path.join(FIXTURES_DIR, fixture_file_name)) as fixture_file:
|
||||
return json.load(fixture_file)
|
||||
|
||||
|
||||
def get_main_database(session):
|
||||
return (
|
||||
db.session.query(models.Database)
|
||||
.filter_by(database_name='main')
|
||||
.first()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user