| |
@@ -110,6 +110,8 @@
|
| |
class TestEmptyDB(object):
|
| |
@classmethod
|
| |
def setup_class(cls):
|
| |
+ cls.context = app.app_context()
|
| |
+ cls.context.push()
|
| |
cls.client = app.test_client()
|
| |
db.session.rollback()
|
| |
db.drop_all()
|
| |
@@ -119,6 +121,7 @@
|
| |
def teardown_class(cls):
|
| |
db.session.rollback()
|
| |
db.drop_all()
|
| |
+ cls.context.pop()
|
| |
|
| |
def test_index_raises(self):
|
| |
"An empty db means no milestone to display, should raise"
|
| |
@@ -130,6 +133,8 @@
|
| |
class TestNotSyncedMilestone(object):
|
| |
@classmethod
|
| |
def setup_class(cls):
|
| |
+ cls.context = app.app_context()
|
| |
+ cls.context.push()
|
| |
cls.client = app.test_client()
|
| |
db.session.rollback()
|
| |
db.drop_all()
|
| |
@@ -142,6 +147,7 @@
|
| |
def teardown_class(cls):
|
| |
db.session.rollback()
|
| |
db.drop_all()
|
| |
+ cls.context.pop()
|
| |
|
| |
def test_not_synced_index(self):
|
| |
rv = self.client.get('/', follow_redirects=True)
|
| |
@@ -169,6 +175,8 @@
|
| |
class TestSyncedMilestone(object):
|
| |
@classmethod
|
| |
def setup_class(cls):
|
| |
+ cls.context = app.app_context()
|
| |
+ cls.context.push()
|
| |
cls.client = app.test_client()
|
| |
db.session.rollback()
|
| |
db.drop_all()
|
| |
@@ -186,6 +194,7 @@
|
| |
def teardown_class(cls):
|
| |
db.session.rollback()
|
| |
db.drop_all()
|
| |
+ cls.context.pop()
|
| |
|
| |
def test_display_index(self):
|
| |
rv = self.client.get('/', follow_redirects=True)
|
| |
@@ -223,6 +232,8 @@
|
| |
class TestGetFunctions(object):
|
| |
@classmethod
|
| |
def setup_method(self):
|
| |
+ self.context = app.app_context()
|
| |
+ self.context.push()
|
| |
self.client = app.test_client()
|
| |
db.session.rollback()
|
| |
db.drop_all()
|
| |
@@ -278,6 +289,7 @@
|
| |
db.session.rollback()
|
| |
db.session.close()
|
| |
db.drop_all()
|
| |
+ self.context.pop()
|
| |
|
| |
def test_get_milestone_updates(self):
|
| |
updates = main.get_milestone_updates(self.milestone)
|
| |
Fixes https://pagure.io/fedora-qa/blockerbugs/issue/260
(As a bonus, prepares bba for sqlalchemy 2.x)