changeset 586:efc0fcd76f43 pytest2

init_test_app and deinit_test_app called in test_Item
author pkumar <contactprashantat@gmail.com>
date Wed, 22 Jun 2011 00:37:43 +0530
parents 6610f364cfae
children e2794fc7f3fb
files MoinMoin/items/_tests/test_Item.py
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/items/_tests/test_Item.py	Wed Jun 22 00:33:06 2011 +0530
+++ b/MoinMoin/items/_tests/test_Item.py	Wed Jun 22 00:37:43 2011 +0530
@@ -13,8 +13,17 @@
 from MoinMoin._tests import become_trusted
 from MoinMoin.items import Item, ApplicationXTar, NonExistent, Binary, Text, Image, TransformableBitmapImage
 from MoinMoin.config import CONTENTTYPE, ADDRESS, COMMENT, HOSTNAME, USERID, ACTION
+from MoinMoin.conftest import init_test_app, deinit_test_app
+from MoinMoin._tests import wikiconfig
 
 class TestItem(object):
+    def setup_method(self, method):
+        # temporary hack till we get some cleanup mechanism for tests.  
+        self.app, self.ctx = init_test_app(wikiconfig.Config)
+        
+    def teardown_method(self, method):
+        deinit_test_app(self.app, self.ctx)     
+
     def testNonExistent(self):
         item = Item.create('DoesNotExist')
         assert isinstance(item, NonExistent)
@@ -104,6 +113,13 @@
     """
     tests for the container items
     """
+    def setup_method(self, method):
+        # temporary hack till we get some cleanup mechanism for tests.  
+        self.app, self.ctx = init_test_app(wikiconfig.Config)
+        
+    def teardown_method(self, method):
+        deinit_test_app(self.app, self.ctx)     
+
     def testCreateContainerRevision(self):
         """
         creates a container and tests the content saved to the container