Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make tests pass

  • Loading branch information...
commit a0148862098f9c2dc5b6e59e624fa32fb8f337eb 1 parent 454daae
Chris McDonough mcdonc authored
Showing with 8 additions and 4 deletions.
  1. +4 −2 shootout/tests/test_models.py
  2. +4 −2 shootout/tests/test_views.py
6 shootout/tests/test_models.py
View
@@ -9,10 +9,10 @@ def _initTestingDB():
from shootout.models import Base
from sqlalchemy import create_engine
engine = create_engine('sqlite://')
- session = DBSession()
- session.configure(bind=engine)
+ DBSession.configure(bind=engine)
Base.metadata.bind = engine
Base.metadata.create_all(engine)
+ session = DBSession()
return session
@@ -22,7 +22,9 @@ def setUp(self):
def tearDown(self):
import transaction
+ from shootout.models import DBSession
transaction.abort()
+ DBSession.remove()
testing.tearDown()
def _addUser(self, username=u'username'):
6 shootout/tests/test_views.py
View
@@ -8,10 +8,10 @@ def _initTestingDB():
from shootout.models import Base
from sqlalchemy import create_engine
engine = create_engine('sqlite://')
- session = DBSession()
- session.configure(bind=engine)
+ DBSession.configure(bind=engine)
Base.metadata.bind = engine
Base.metadata.create_all(engine)
+ session = DBSession()
return session
@@ -42,7 +42,9 @@ def setUp(self):
def tearDown(self):
import transaction
+ from shootout.models import DBSession
transaction.abort()
+ DBSession.remove()
testing.tearDown()
def _addUser(self, username=u'username'):
Please sign in to comment.
Something went wrong with that request. Please try again.