Small improvments to tests
This commit is contained in:
parent
4a9987affa
commit
c3f0597c07
|
|
@ -5,6 +5,7 @@ from flask.ext.appbuilder import SQLA, AppBuilder, IndexView
|
|||
from flask.ext.migrate import Migrate
|
||||
from panoramix import config
|
||||
|
||||
|
||||
APP_DIR = os.path.dirname(__file__)
|
||||
CONFIG_MODULE = os.environ.get('PANORAMIX_CONFIG', 'panoramix.config')
|
||||
|
||||
|
|
@ -26,5 +27,7 @@ appbuilder = AppBuilder(
|
|||
indexview=MyIndexView,
|
||||
security_manager_class=app.config.get("CUSTOM_SECURITY_MANAGER"))
|
||||
|
||||
sm = appbuilder.sm
|
||||
|
||||
get_session = appbuilder.get_session
|
||||
from panoramix import views
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@ import unittest
|
|||
import urllib2
|
||||
os.environ['PANORAMIX_CONFIG'] = 'tests.panoramix_test_config'
|
||||
from flask.ext.testing import LiveServerTestCase, TestCase
|
||||
from flask_login import login_user
|
||||
|
||||
from panoramix import app, db, models
|
||||
from panoramix import app, appbuilder, db, models
|
||||
BASE_DIR = app.config.get("BASE_DIR")
|
||||
cli = imp.load_source('cli', BASE_DIR + "/bin/panoramix")
|
||||
|
||||
|
|
@ -18,7 +19,7 @@ class LiveTest(TestCase):
|
|||
return app
|
||||
|
||||
def setUp(self):
|
||||
print BASE_DIR
|
||||
pass
|
||||
|
||||
def test_load_examples(self):
|
||||
cli.load_examples(sample=True)
|
||||
|
|
@ -28,6 +29,7 @@ class LiveTest(TestCase):
|
|||
for slc in db.session.query(Slc).all():
|
||||
self.client.get(slc.slice_url)
|
||||
viz = slc.viz
|
||||
self.client.get(viz.get_url())
|
||||
if hasattr(viz, 'get_json'):
|
||||
self.client.get(viz.get_json())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue