diff MoinMoin/_tests/test_user.py @ 4027:0d6724b87856

Refactored TestConfig creation for py.test based unit tests. The method used before had multiple problems: config creation did not use inheritance (as it does when used the wiki in production). It also didn't do the post processing done in __init__ of Config class. Also, it first created the request with some default config, then created the TestConfig (but some stuff in request was not initialized correctly)... The new method now uses config inheritance in the same way as a production wiki does. The TestConfig instance is created in RequestBase __init__, it does not use sys.path any more to import the test wikiconfig, but does an absolute import from MoinMoin._tests.wikiconfig. TODO: * fix the failing test_pysupport.TestImportExisting.testExisting * auth tests are currently skipped because they need more work * find a better way than staticmethod(TestConfig)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 24 Aug 2008 02:01:34 +0200
parents 2f2c95506713
children 62177a952833 052b6926c82d
line wrap: on
line diff
--- a/MoinMoin/_tests/test_user.py	Fri Aug 22 23:30:38 2008 +0200
+++ b/MoinMoin/_tests/test_user.py	Sun Aug 24 02:01:34 2008 +0200
@@ -178,19 +178,9 @@
 class TestGroupName(object):
-    def setUp(self):
-        self.config = self.TestConfig(page_group_regex=r'.+Group')
-    def tearDown(self):
-        del self.config
-    import re
-    group = re.compile(r'.+Group', re.UNICODE)
     def testGroupNames(self):
         """ user: isValidName: reject group names """
         test = u'AdminGroup'
-        assert self.group.search(test)
         assert not user.isValidName(self.request, test)