changeset 892:9931a09387b0

some whitespace cleanup in the tests
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 06 Jul 2006 21:16:28 +0200
parents ba1b39629510
children 324b2948d197
files MoinMoin/_tests/test_Page.py MoinMoin/_tests/test_PageEditor.py MoinMoin/_tests/test_error.py MoinMoin/_tests/test_formatter.py MoinMoin/_tests/test_macro.py MoinMoin/_tests/test_mail_sendmail.py MoinMoin/_tests/test_packages.py MoinMoin/_tests/test_pysupport.py MoinMoin/_tests/test_search.py MoinMoin/_tests/test_security.py MoinMoin/_tests/test_user.py
diffstat 11 files changed, 101 insertions(+), 103 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_Page.py	Thu Jul 06 20:50:46 2006 +0200
+++ b/MoinMoin/_tests/test_Page.py	Thu Jul 06 21:16:28 2006 +0200
@@ -11,7 +11,7 @@
 
 class existsTestCase(unittest.TestCase):
     """Page: testing wiki page"""
-    
+
     def testExists(self):
         """ Page: page.exists() finds existing pages only """
         tests = (
--- a/MoinMoin/_tests/test_PageEditor.py	Thu Jul 06 20:50:46 2006 +0200
+++ b/MoinMoin/_tests/test_PageEditor.py	Thu Jul 06 21:16:28 2006 +0200
@@ -13,7 +13,7 @@
 
 
 class ExpandVarsTestCase(unittest.TestCase):
-    """PageEditor: testing page editor"""   
+    """PageEditor: testing page editor"""
 
     pagename = u'AutoCreatedMoinMoinTemporaryTestPage'
 
@@ -33,7 +33,7 @@
         for var, expected in self._tests:
             result = self.page._expand_variables(var)
             self.assertEqual(result, expected,
-                'Expected "%(expected)s" but got "%(result)s"' % locals())   
+                'Expected "%(expected)s" but got "%(result)s"' % locals())
 
 
 class ExpandUserNameTest(unittest.TestCase):
@@ -43,7 +43,7 @@
     """
     pagename = u'AutoCreatedMoinMoinTemporaryTestPage'
     variable = u'@USERNAME@'
-    
+
     def setUp(self):
         self.page = PageEditor(self.request, self.pagename)
         self.savedName = self.request.user.name
@@ -51,24 +51,24 @@
 
     def tearDown(self):
         self.request.user.name = self.savedName
-    
+
     def expand(self):
         return self.page._expand_variables(self.variable)
 
 
 class ExpandCamelCaseName(ExpandUserNameTest):
-    
+
     name = u'UserName'
-    
+
     def testExpandCamelCaseUserName(self):
         """ PageEditor: expand @USERNAME@ CamelCase """
         self.assertEqual(self.expand(), self.name)
 
 
 class ExpandExtendedName(ExpandUserNameTest):
-    
+
     name = u'user name'
-    
+
     def testExtendedNamesEnabled(self):
         """ PageEditor: expand @USERNAME@ extended name - enabled """
         try:
@@ -77,7 +77,7 @@
         finally:
             del config
 
-        
+
 class ExpandMailto(ExpandUserNameTest):
 
     variable = u'@MAILTO@'
@@ -95,11 +95,11 @@
         ExpandUserNameTest.tearDown(self)
         self.request.user.valid = self.savedValid
         self.request.user.email = self.savedEmail
-    
+
     def testMailto(self):
         """ PageEditor: expand @MAILTO@ """
         self.assertEqual(self.expand(), u'[[MailTo(%s)]]' % self.email)
-        
+
 
 class ExpandPrivateVariables(ExpandUserNameTest):
 
@@ -107,7 +107,7 @@
     name = u'AutoCreatedMoinMoinTemporaryTestUser'
     dictPage = name + '/MyDict'
     shouldDeleteTestPage = True
-    
+
     def setUp(self):
         ExpandUserNameTest.setUp(self)
         self.savedValid = self.request.user.valid
@@ -121,7 +121,7 @@
         self.deleteTestPage()
 
     def testPrivateVariables(self):
-        """ PageEditor: expand user variables """        
+        """ PageEditor: expand user variables """
         self.assertEqual(self.expand(), self.name)
 
     def createTestPage(self):
@@ -135,7 +135,7 @@
         path = self.dictPagePath()
         if os.path.exists(path):
             self.shouldDeleteTestPage = False
-            raise TestSkiped("%s exists. Won't overwrite exiting page" % 
+            raise TestSkiped("%s exists. Won't overwrite exiting page" %
                              self.dictPage)
         try:
             os.mkdir(path)
@@ -157,14 +157,14 @@
         if hasattr(self.request.cfg, 'DICTS_DATA'):
             del self.request.cfg.DICTS_DATA
         self.request.pages = {}
-        
+
     def deleteTestPage(self):
         """ Delete temporary page, bypass logs and notifications """
         if self.shouldDeleteTestPage:
             import shutil
             shutil.rmtree(self.dictPagePath(), True)
-        
+
     def dictPagePath(self):
         page = Page(self.request, self.dictPage)
         return page.getPagePath(use_underlay=0, check_create=0)
-        
+
--- a/MoinMoin/_tests/test_error.py	Thu Jul 06 20:50:46 2006 +0200
+++ b/MoinMoin/_tests/test_error.py	Thu Jul 06 21:16:28 2006 +0200
@@ -19,13 +19,13 @@
         err = error.Error(u'טעות')
         self.assertEqual(unicode(err), u'טעות')
         self.assertEqual(str(err), 'טעות')
-        
+
     def testCreateWithEncodedString(self):
         """ error: create with encoded string """
         err = error.Error('טעות')
         self.assertEqual(unicode(err), u'טעות')
         self.assertEqual(str(err), 'טעות')
-         
+
     def testCreateWithObject(self):
         """ error: create with any object """
         class Foo:
@@ -33,15 +33,14 @@
                 return u'טעות'
             def __str__(self):
                 return 'טעות'
-        
+
         err = error.Error(Foo())
         self.assertEqual(unicode(err), u'טעות')
         self.assertEqual(str(err), 'טעות')
-         
+
     def testAccessLikeDict(self):
         """ error: access error like a dict """
         test = 'value'
         err = error.Error(test)
         self.assertEqual('%(message)s' % err, test)
 
-
--- a/MoinMoin/_tests/test_formatter.py	Thu Jul 06 20:50:46 2006 +0200
+++ b/MoinMoin/_tests/test_formatter.py	Thu Jul 06 21:16:28 2006 +0200
@@ -20,7 +20,6 @@
         for f_name in formatters:
             #if f_name in ('dom_xml', ):
             #    continue
-            
             try:
                 formatter = wikiutil.importPlugin(self.request.cfg, "formatter", f_name, "Formatter")
             except wikiutil.PluginAttributeError:
@@ -40,6 +39,6 @@
         self.request.formatter = page.formatter = formatter(self.request)
         #page.formatter.setPage(page)
         #page.hilite_re = None
-        
+
         return self.request.redirectedOutput(page.send_page, self.request)
 
--- a/MoinMoin/_tests/test_macro.py	Thu Jul 06 20:50:46 2006 +0200
+++ b/MoinMoin/_tests/test_macro.py	Thu Jul 06 21:16:28 2006 +0200
@@ -21,7 +21,7 @@
         expected = m.formatter.linebreak(0)
         result = m.execute("BR", "")
         self.assertEqual(result, expected,
-            'Expected "%(expected)s" but got "%(result)s"' % locals())        
+            'Expected "%(expected)s" but got "%(result)s"' % locals())
 
     def _make_macro(self):
         """Test helper"""
@@ -31,3 +31,4 @@
         p.form = self.request.form
         m = macro.Macro(p)
         return m
+
--- a/MoinMoin/_tests/test_mail_sendmail.py	Thu Jul 06 20:50:46 2006 +0200
+++ b/MoinMoin/_tests/test_mail_sendmail.py	Thu Jul 06 21:16:28 2006 +0200
@@ -15,7 +15,7 @@
 
 class decodeSpamSafeEmailTestCase(unittest.TestCase):
     """mail.sendmail: testing mail"""
-    
+
     _tests = (
         ('', ''),
         ('AT', '@'),
@@ -54,7 +54,7 @@
     mailbox     =   name-addr / addr-spec
     name-addr   =   [display-name] angle-addr
     angle-addr  =   [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr
-    """    
+    """
     charset = Charset(config.charset)
     charset.header_encoding = QP
     charset.body_encoding = QP
@@ -73,7 +73,7 @@
         expected = phrase + '<local@domain>'
         self.failUnlessEqual(sendmail.encodeAddress(address, self.charset),
                              expected)
-                             
+
     def testCompositeUnicode(self):
         """ mail.sendmail: encode Uncode address: 'ויקי <local@domain>' """
         address = u'ויקי <local@domain>'
@@ -81,14 +81,14 @@
         expected = phrase + '<local@domain>'
         self.failUnlessEqual(sendmail.encodeAddress(address, self.charset),
                              expected)
-                             
+
     def testEmptyPhrase(self):
         """ mail.sendmail: encode address with empty phrase: '<local@domain>' """
         address = u'<local@domain>'
         expected = address.encode(config.charset)
         self.failUnlessEqual(sendmail.encodeAddress(address, self.charset),
                              expected)
-                             
+
     def testEmptyAddress(self):
         """ mail.sendmail: encode address with empty address: 'Phrase <>' 
         
@@ -112,3 +112,4 @@
         expected = address.encode(config.charset)
         self.failUnlessEqual(sendmail.encodeAddress(address, self.charset),
                              expected)
+
--- a/MoinMoin/_tests/test_packages.py	Thu Jul 06 20:50:46 2006 +0200
+++ b/MoinMoin/_tests/test_packages.py	Thu Jul 06 21:16:28 2006 +0200
@@ -44,7 +44,7 @@
 
     def isPackage(self):
         return True
-    
+
 class UnsafePackageTestcase(TestCase):
     """ Tests various things in the packages package. Note that this package does
         not care to clean up and needs to run in a test wiki because of that. """
@@ -52,7 +52,7 @@
     def setUp(self):
         if not getattr(self.request.cfg, 'is_test_wiki', False):
             raise TestSkipped('This test needs to be run using the test wiki.')
-   
+
     def testBasicPackageThings(self):
         myPackage = DebugPackage(self.request, 'test')
         myPackage.installPackage()
@@ -66,3 +66,4 @@
     def testQuoting(self):
         for line in ([':foo', 'is\\', 'ja|', u't|', u'baAz'], [], ['', '']):
             self.assertEqual(line, unpackLine(packLine(line)))
+
--- a/MoinMoin/_tests/test_pysupport.py	Thu Jul 06 20:50:46 2006 +0200
+++ b/MoinMoin/_tests/test_pysupport.py	Thu Jul 06 21:16:28 2006 +0200
@@ -21,25 +21,25 @@
     def testNonExistingModule(self):
         """ pysupport: import nonexistent module raises ImportError """
         self.assertRaises(ImportError, pysupport.importName,
-                          'MoinMoin.parser.abcdefghijkl','Parser')
+                          'MoinMoin.parser.abcdefghijkl', 'Parser')
 
     def testNonExistingAttribute(self):
         """ pysupport: import nonexistent attritbue raises AttributeError """
         self.assertRaises(AttributeError, pysupport.importName,
-                          'MoinMoin.parser.text_moin_wiki','NoSuchParser')
+                          'MoinMoin.parser.text_moin_wiki', 'NoSuchParser')
 
     def testExisting(self):
         """ pysupport: import name from existing module """
         from MoinMoin.parser import text_moin_wiki
         Parser = pysupport.importName('MoinMoin.parser.text_moin_wiki', 'Parser')
         self.failUnless(Parser is text_moin_wiki.Parser)
-   
+
 
 class ImportNameFromPlugin(unittest.TestCase):
     """ Base class for import plugin tests """
-    
+
     name = 'Parser'
-    
+
     def setUp(self):
         """ Check for valid plugin package """
         self.pluginDirectory = os.path.join(self.request.cfg.data_dir, 'plugin', 'parser')
@@ -60,7 +60,7 @@
 
 
 class ImportNonExisiting(ImportNameFromPlugin):
-    
+
     plugin = 'NonExistingWikiPlugin'
 
     def testNonEsisting(self):
@@ -111,7 +111,7 @@
             file(self.pluginFilePath('.py'), 'w').write(data)
         except Exception, err:
             raise TestSkiped("Can't create test plugin: %s" % str(err))
-        
+
     def deleteTestPlugin(self):
         """ Delete plugin files ignoring missing files errors """
         if not self.shouldDeleteTestPlugin:
--- a/MoinMoin/_tests/test_search.py	Thu Jul 06 20:50:46 2006 +0200
+++ b/MoinMoin/_tests/test_search.py	Thu Jul 06 21:16:28 2006 +0200
@@ -21,7 +21,7 @@
 
     def setUp(self):
         self.parser = search.QueryParser()
-   
+
     def testIsQuoted(self):
         """ search: quoting bug - quoted terms """
         for case in ('"yes"', "'yes'"):
@@ -29,8 +29,8 @@
 
     def testIsNot(self):
         """ search: quoting bug - unquoted terms """
-        tests = ('', "'", '"', '""', "''", "'\"",'"no', 'no"', "'no", 
+        tests = ('', "'", '"', '""', "''", "'\"", '"no', 'no"', "'no",
                  "no'", '"no\'')
         for case in tests:
             self.assertEqual(self.parser.isQuoted(case), False)
-    
+
--- a/MoinMoin/_tests/test_security.py	Thu Jul 06 20:50:46 2006 +0200
+++ b/MoinMoin/_tests/test_security.py	Thu Jul 06 21:16:28 2006 +0200
@@ -13,14 +13,13 @@
 acliter = security.ACLStringIterator
 
 class ACLStringIteratorTestCase(unittest.TestCase):
-    
+
     def setUp(self):
         self.config = TestConfig(self.request,
                                  defaults=['acl_rights_valid', 'acl_rights_before'])
-                
     def tearDown(self):
         del self.config
-        
+
     def testEmpty(self):
         """ security: empty acl string raise StopIteration """
         iter = acliter(self.request.cfg.acl_rights_valid, '')
@@ -30,16 +29,16 @@
         """ security: white space acl string raise StopIteration """
         iter = acliter(self.request.cfg.acl_rights_valid, '       ')
         self.failUnlessRaises(StopIteration, iter.next)
-            
+
     def testDefault(self):
         """ security: default meta acl """
         iter = acliter(self.request.cfg.acl_rights_valid, 'Default Default')
         for mod, entries, rights in iter:
             self.assertEqual(entries, ['Default'])
             self.assertEqual(rights, [])
-                
+
     def testEmptyRights(self):
-        """ security: empty rights """    
+        """ security: empty rights """
         iter = acliter(self.request.cfg.acl_rights_valid, 'WikiName:')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['WikiName'])
@@ -57,21 +56,21 @@
         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne,UserTwo:read,write')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['UserOne', 'UserTwo'])
-        self.assertEqual(rights, ['read', 'write'])      
-        
+        self.assertEqual(rights, ['read', 'write'])
+
     def testMultipleEntries(self):
         """ security: multiple entries """
         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne:read,write UserTwo:read All:')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['UserOne'])
-        self.assertEqual(rights, ['read', 'write'])      
+        self.assertEqual(rights, ['read', 'write'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['UserTwo'])
-        self.assertEqual(rights, ['read'])      
+        self.assertEqual(rights, ['read'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['All'])
-        self.assertEqual(rights, [])      
-       
+        self.assertEqual(rights, [])
+
     def testNameWithSpaces(self):
         """ security: single name with spaces """
         iter = acliter(self.request.cfg.acl_rights_valid, 'user one:read')
@@ -84,27 +83,27 @@
         iter = acliter(self.request.cfg.acl_rights_valid, 'user one,user two:read')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['user one', 'user two'])
-        self.assertEqual(rights, ['read'])      
-        
+        self.assertEqual(rights, ['read'])
+
     def testMultipleEntriesWithSpaces(self):
         """ security: multiple entries with spaces """
         iter = acliter(self.request.cfg.acl_rights_valid, 'user one:read,write user two:read')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['user one'])
-        self.assertEqual(rights, ['read', 'write'])      
+        self.assertEqual(rights, ['read', 'write'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['user two'])
-        self.assertEqual(rights, ['read'])      
-         
+        self.assertEqual(rights, ['read'])
+
     def testMixedNames(self):
         """ security: mixed wiki names and names with spaces """
         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne,user two:read,write user three,UserFour:read')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['UserOne', 'user two'])
-        self.assertEqual(rights, ['read', 'write'])      
+        self.assertEqual(rights, ['read', 'write'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['user three', 'UserFour'])
-        self.assertEqual(rights, ['read'])      
+        self.assertEqual(rights, ['read'])
 
     def testModifier(self):
         """ security: acl modifiers """
@@ -117,7 +116,7 @@
         self.assertEqual(mod, '-')
         self.assertEqual(entries, ['UserTwo'])
         self.assertEqual(rights, [])
-        
+
     def testIgnoreInvalidACL(self):
         """ security: ignore invalid acl
 
@@ -129,7 +128,7 @@
         self.assertEqual(entries, ['UserOne'])
         self.assertEqual(rights, ['read'])
         self.failUnlessRaises(StopIteration, iter.next)
-        
+
     def testEmptyNamesWithRight(self):
         """ security: empty names with rights
 
@@ -142,7 +141,7 @@
         self.assertEqual(rights, ['read'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, [])
-        self.assertEqual(rights, ['read'])        
+        self.assertEqual(rights, ['read'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['All'])
         self.assertEqual(rights, [])
@@ -151,7 +150,7 @@
         """ security: ignore rights not in acl_rights_valid """
         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne:read,sing,write,drink,sleep')
         mod, entries, rights = iter.next()
-        self.assertEqual(rights, ['read', 'write'])        
+        self.assertEqual(rights, ['read', 'write'])
 
     def testBadGuy(self):
         """ security: bad guy may not allowed anything
@@ -169,14 +168,14 @@
         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne,user two:read,write   user three,UserFour:read  All:')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['UserOne', 'user two'])
-        self.assertEqual(rights, ['read', 'write'])      
+        self.assertEqual(rights, ['read', 'write'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['user three', 'UserFour'])
-        self.assertEqual(rights, ['read'])      
+        self.assertEqual(rights, ['read'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['All'])
-        self.assertEqual(rights, [])            
-       
+        self.assertEqual(rights, [])
+
 
 class AclTestCase(unittest.TestCase):
     """ security: testing access control list
@@ -187,12 +186,12 @@
         # Backup user
         self.config = TestConfig(self.request, defaults=['acl_rights_valid', 'acl_rights_before'])
         self.savedUser = self.request.user.name
-        
+
     def tearDown(self):
         # Restore user
         self.request.user.name = self.savedUser
         del self.config
-        
+
     def testApplyACLByUser(self):
         """ security: applying acl by user name"""
         # This acl string...
@@ -226,7 +225,7 @@
             # All other users - every one not mentioned in the acl lines
             ('All',                 ('read',)),
             ('Anonymous',           ('read',)),
-            )       
+            )
 
         # Check rights
         for user, may in users:
@@ -240,4 +239,4 @@
             for right in mayNot:
                 self.failIf(acl.may(self.request, user, right),
                     '"%(user)s" should NOT be allowed to "%(right)s"' % locals())
-            
+
--- a/MoinMoin/_tests/test_user.py	Thu Jul 06 20:50:46 2006 +0200
+++ b/MoinMoin/_tests/test_user.py	Thu Jul 06 21:16:28 2006 +0200
@@ -20,7 +20,7 @@
         """user: encode ascii password"""
         # u'MoinMoin' and 'MoinMoin' should be encoded to same result
         expected = "{SHA}X+lk6KR7JuJEH43YnmettCwICdU="
-        
+
         result = user.encodePassword("MoinMoin")
         self.assertEqual(result, expected,
                          'Expected "%(expected)s" but got "%(result)s"' % locals())
@@ -43,7 +43,7 @@
         # Save original user and cookie
         self.saved_cookie = self.request.saved_cookie
         self.saved_user = self.request.user
-        
+
         # Create anon user for the tests
         self.request.saved_cookie = ''
         self.request.user = user.User(self.request)
@@ -54,7 +54,7 @@
             del dircache.cache[self.request.cfg.user_dir]
         except KeyError:
             pass
-        
+
     def tearDown(self):
         """ Run after each test
         
@@ -72,25 +72,25 @@
         # Restore original user
         self.request.saved_cookie = self.saved_cookie
         self.request.user = self.saved_user
-                
+
         # Remove user name to id cache, or next test will fail
         caching.CacheEntry(self.request, 'user', 'name2id', scope='wiki').remove()
         del self.request.cfg._name2id
-        
+
         # Prevent user list caching - we create and delete users too
         # fast for that.
         try:
             del dircache.cache[self.request.cfg.user_dir]
         except KeyError:
             pass
-              
+
     def testAsciiPassword(self):
         """ user: login with ascii password """
         # Create test user
         name = u'__Non Existent User Name__'
         password = name
         self.createUser(name, password)
-        
+
         # Try to "login"           
         theUser = user.User(self.request, name=name, password=password)
         self.failUnless(theUser.valid, "Can't login with ascii password")
@@ -101,7 +101,7 @@
         name = u'__שם משתמש לא קיים__' # Hebrew
         password = name
         self.createUser(name, password)
-        
+
         # Try to "login"
         theUser = user.User(self.request, name=name, password=password)
         self.failUnless(theUser.valid, "Can't login with unicode password")
@@ -119,7 +119,7 @@
         name = u'__Jürgen Herman__'
         password = name
         self.createUser(name, password, charset='iso-8859-1')
-        
+
         # Try to "login"           
         theUser = user.User(self.request, name=name, password=password)
         self.failUnless(theUser.valid, "Can't login with old unicode password")
@@ -136,7 +136,6 @@
         name = u'__Jürgen Herman__'
         password = name
         self.createUser(name, password, charset='iso-8859-1')
-        
         # Login - this should replace the old password in the user file         
         theUser = user.User(self.request, name=name, password=password)
         # Login again - the password should be new unicode password
@@ -144,61 +143,61 @@
         theUser = user.User(self.request, name=name, password=password)
         self.assertEqual(theUser.enc_password, expected,
                          "User password was not replaced with new")
-            
+
     # Helpers ---------------------------------------------------------
-    
+
     def createUser(self, name, password, charset='utf-8'):
         """ helper to create test user 
         
         charset is used to create user with pre 1.3 password hash
         """
         # Hack self.request form to contain the password
-        self.request.form['password'] = [password]  
-        
+        self.request.form['password'] = [password]
+
         # Create user
         self.user = user.User(self.request)
         self.user.name = name
         self.user.enc_password = user.encodePassword(password, charset=charset)
-        
+
         # Validate that we are not modifying existing user data file!
         if self.user.exists():
             self.user = None
             raise TestsSkiped("Test user exists, will not override existing"
                               " user data file!")
-        
+
         # Save test user
         self.user.save()
-        
+
         # Validate user creation
         if not self.user.exists():
             self.user = None
             raise TestsSkiped("Can't create test user")
-                        
+
 
 class GroupNameTestCase(unittest.TestCase):
 
     def setUp(self):
         self.config = TestConfig(self.request,
-                                 page_group_regex = r'.+Group')              
+                                 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 """   
+        """ user: isValidName: reject group names """
         test = u'AdminGroup'
         assert self.group.search(test)
         result = user.isValidName(self.request, test)
         expected = False
         self.assertEqual(result, expected,
-                        'Expected "%(expected)s" but got "%(result)s"' % locals()) 
-            
+                        'Expected "%(expected)s" but got "%(result)s"' % locals())
+
 
 class IsValidNameTestCase(unittest.TestCase):
-    
+
     def testNonAlnumCharacters(self):
         """ user: isValidName: reject unicode non alpha numeric characters
 
@@ -209,9 +208,9 @@
         expected = False
         for c in invalid:
             name = base % c
-            result = user.isValidName(self.request, name)           
+            result = user.isValidName(self.request, name)
         self.assertEqual(result, expected,
-                         'Expected "%(expected)s" but got "%(result)s"' % locals()) 
+                         'Expected "%(expected)s" but got "%(result)s"' % locals())
 
     def testWhitespace(self):
         """ user: isValidName: reject leading, trailing or multiple whitespace """
@@ -222,7 +221,7 @@
             )
         expected = False
         for test in cases:
-            result = user.isValidName(self.request, test)          
+            result = user.isValidName(self.request, test)
             self.assertEqual(result, expected,
                          'Expected "%(expected)s" but got "%(result)s"' % locals())
 
@@ -236,8 +235,7 @@
             )
         expected = True
         for test in cases:
-            result = user.isValidName(self.request, test)          
+            result = user.isValidName(self.request, test)
             self.assertEqual(result, expected,
                              'Expected "%(expected)s" but got "%(result)s"' % locals())
 
-