Back to index

moin  1.9.0~rc2
Public Member Functions
MoinMoin._tests.test_user.TestIsValidName Class Reference

List of all members.

Public Member Functions

def testNonAlnumCharacters
def testWhitespace
def testValid

Detailed Description

Definition at line 212 of file test_user.py.


Member Function Documentation

user: isValidName: reject unicode non alpha numeric characters

: and , used in acl rules, we might add more characters to the syntax.

Definition at line 214 of file test_user.py.

00214 
00215     def testNonAlnumCharacters(self):
00216         """ user: isValidName: reject unicode non alpha numeric characters
00217 
00218         : and , used in acl rules, we might add more characters to the syntax.
00219         """
00220         invalid = u'! # $ % ^ & * ( ) = + , : ; " | ~ / \\ \u0000 \u202a'.split()
00221         base = u'User%sName'
00222         for c in invalid:
00223             name = base % c
00224             assert not user.isValidName(self.request, name)

Here is the call graph for this function:

user: isValidName: accept names in any language, with spaces 

Definition at line 235 of file test_user.py.

00235 
00236     def testValid(self):
00237         """ user: isValidName: accept names in any language, with spaces """
00238         cases = (
00239             u'Jürgen Hermann', # German
00240             u'ניר סופר', # Hebrew
00241             u'CamelCase', # Good old camel case
00242             u'가각간갇갈 갉갊감 갬갯걀갼' # Hangul (gibberish)
00243             )
00244         for test in cases:
00245             assert user.isValidName(self.request, test)
00246 

Here is the call graph for this function:

user: isValidName: reject leading, trailing or multiple whitespace 

Definition at line 225 of file test_user.py.

00225 
00226     def testWhitespace(self):
00227         """ user: isValidName: reject leading, trailing or multiple whitespace """
00228         cases = (
00229             u' User Name',
00230             u'User Name ',
00231             u'User   Name',
00232             )
00233         for test in cases:
00234             assert not user.isValidName(self.request, test)

Here is the call graph for this function:


The documentation for this class was generated from the following file: