Skip to content

Commit

Permalink
Add couple of tests with Flask-Testing (#37).
Browse files Browse the repository at this point in the history
Until #56 is fixed we can't advance, though.
  • Loading branch information
porduna committed Jul 15, 2014
1 parent 996cd3b commit 950dde4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions labmanager/tests/test_public.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from flask import Flask
from labmanager.tests.util import G4lTestCase

class TestPublicLabs(G4lTestCase):
def test_what(self):
response = self.client.get('/public/labs/public/')
self.assert_200(response)

18 changes: 18 additions & 0 deletions labmanager/tests/util.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from flask.ext.testing import TestCase
from labmanager import app
from labmanager.sample_data import add_sample_users
from labmanager.db import db_session

class G4lTestCase(TestCase):
SQLALCHEMY_DATABASE_URI = "sqlite://"
TESTING = True

def create_app(self):
return app

def setUp(self):
add_sample_users()

def tearDown(self):
db_session.remove()

0 comments on commit 950dde4

Please sign in to comment.