Ejemplo n.º 1
0
Archivo: locations.py Proyecto: p/midge
 def handle_get(self, session_id, values, wfile):
     user = self.application.get_user(session_id)
     templates.header(wfile)
     templates.title(wfile, "Create a new user account")
     if user:
         templates.paragraph(
             wfile,
             'Note that you are already logged in as '
             '<b>%s</b> with a username of <b>%s</b>.' %
             (user.name, user.username))
         templates.paragraph(
             wfile,
             'It is unlikely that you wish to create a new user account, '
             'as this is normally performed by the new user. '
             'However if you really need to create a new account, '
             'fill in the following form and click the '
             '"Create account" button.')
     else:
         templates.paragraph(
             wfile,
             'If you are sure that you do not already have a user account, '
             'fill in the following form and click the '
             '"Create account" button.')
         templates.paragraph(
             wfile,
             'Note that the Username must be unique, and so you '
             'will not be allowed to create a new account with an existing '
             'Username.')
     templates.add_user_form(wfile, self.path)
     templates.footer(wfile)
Ejemplo n.º 2
0
 def test_add_user_form(self):
     """Check add user form"""
     wfile = self.get_wfile()
     templates.add_user_form(wfile, "a path")
     self.assert_(self.is_well_formed(wfile))