changeset 580:229747dcc230 pytest2

teardown created in test_wiki_groups and test_wiki_dicts to call deinit_test_app
author pkumar <contactprashantat@gmail.com>
date Tue, 21 Jun 2011 02:20:24 +0530
parents 9db7ce03cbc5
children cfc4cefc5182
files MoinMoin/datastruct/backends/_tests/test_wiki_dicts.py MoinMoin/datastruct/backends/_tests/test_wiki_groups.py
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/datastruct/backends/_tests/test_wiki_dicts.py	Tue Jun 21 02:14:03 2011 +0530
+++ b/MoinMoin/datastruct/backends/_tests/test_wiki_dicts.py	Tue Jun 21 02:20:24 2011 +0530
@@ -25,7 +25,7 @@
 
     def setup_method(self, method):
         # temporary hack till we apply test cleanup mechanism on tests.
-        init_test_app(wikiconfig.Config)
+        self.app, self.ctx = init_test_app(wikiconfig.Config)
         become_trusted()
 
         somedict = {u"First": u"first item",
@@ -38,6 +38,8 @@
                     u"Two": u"2"}
         update_item(u'SomeOtherTestDict', 0, {SOMEDICT: somedict}, DATA)
 
+    def teardown_method(self, method):
+        deinit_test_app(self.app, self.ctx)
 
 coverage_modules = ['MoinMoin.datastruct.backends.wiki_dicts']
 
--- a/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py	Tue Jun 21 02:14:03 2011 +0530
+++ b/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py	Tue Jun 21 02:20:24 2011 +0530
@@ -33,11 +33,14 @@
 
     def setup_method(self, method):
         # temporary hack till we apply test cleanup mechanism on tests.
-        init_test_app(wikiconfig.Config)
+        self.app, self.ctx = init_test_app(wikiconfig.Config)
         become_trusted()
         for group, members in self.test_groups.iteritems():
             update_item(group, 0, {USERGROUP: members}, DATA)
 
+    def teardown_method(self, method):
+        deinit_test_app(self.app, self.ctx)
+    
     def test_rename_group_item(self):
         """
         Tests renaming of a group item.