Skip to content

Commit

Permalink
Small improvments to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Sep 29, 2015
1 parent 4a9987a commit c3f0597
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions panoramix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
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')

Expand All @@ -26,5 +27,7 @@ class MyIndexView(IndexView):
indexview=MyIndexView,
security_manager_class=app.config.get("CUSTOM_SECURITY_MANAGER"))

sm = appbuilder.sm

get_session = appbuilder.get_session
from panoramix import views
6 changes: 4 additions & 2 deletions tests/core_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
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")

Expand All @@ -18,7 +19,7 @@ def create_app(self):
return app

def setUp(self):
print BASE_DIR
pass

def test_load_examples(self):
cli.load_examples(sample=True)
Expand All @@ -28,6 +29,7 @@ def test_slices(self):
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())

Expand Down

0 comments on commit c3f0597

Please sign in to comment.