  <p><label for="id_password2">Password2</label>: <input type="password" name="password2" id="id_password2" /></p>
  <input type="submit" />
  </form>
  
  The label_tag() method takes an optional attrs argument: a dictionary of HTML
  attributes to add to the <label> tag.
  >>> f = UserRegistration(auto_id='id_%s')
  >>> for bf in f:
  ...     print bf.label_tag(attrs={'class': 'pretty'})
 
</s> remove ...    username = CharField(max_length=10)
 </s> add ...    username = CharField(max_length=10, help_text="Good luck picking a username that doesn't already exist.")
User form.[field].help_text to output a field's help text. If the given field
does not have help text, nothing will be output.
>>> t = Template('''<form action="">
... <p>{{ form.username.label_tag }}: {{ form.username }}<br />{{ form.username.help_text }}</p>
... <p>{{ form.password1.label_tag }}: {{ form.password1 }}</p>
... <p>{{ form.password2.label_tag }}: {{ form.password2 }}</p>
... <input type="submit" />
... </form>''')
>>> print t.render(Context({'form': UserRegistration(auto_id=False)}))
<form action="">
<p>Username: <input type="text" name="username" maxlength="10" /><br />Good luck picking a username that doesn't already exist.</p>
<p>Password1: <input type="password" name="password1" /></p>
<p>Password2: <input type="password" name="password2" /></p>
<input type="submit" />
</form>

  <p><label for="id_password2">Password2</label>: <input type="password" name="password2" id="id_password2" /></p>
  <input type="submit" />
  </form>
  
User form.[field].help_text to output a field's help text. If the given field
does not have help text, nothing will be output.
>>> t = Template('''<form action="">
... <p>{{ form.username.label_tag }}: {{ form.username }}<br />{{ form.username.help_text }}</p>
... <p>{{ form.password1.label_tag }}: {{ form.password1 }}</p>
... <p>{{ form.password2.label_tag }}: {{ form.password2 }}</p>
... <input type="submit" />
... </form>''')
>>> print t.render(Context({'form': UserRegistration(auto_id=False)}))
<form action="">
<p>Username: <input type="text" name="username" maxlength="10" /><br />Good luck picking a username that doesn't already exist.</p>
<p>Password1: <input type="password" name="password1" /></p>
<p>Password2: <input type="password" name="password2" /></p>
<input type="submit" />
</form>

  The label_tag() method takes an optional attrs argument: a dictionary of HTML
  attributes to add to the <label> tag.
  >>> f = UserRegistration(auto_id='id_%s')
  >>> for bf in f:
  ...     print bf.label_tag(attrs={'class': 'pretty'})
keep keep keep add keep keep keep keep keep
 Fixed #3456 -- Made it easier/more intuitive to render newforms help_text in templates

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4521 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
tests/regressiontests/forms/tests.py