Changeset 5430


Ignore:
Timestamp:
12 Aug 2010, 17:03:39 (14 years ago)
Author:
Henrik Bettermann
Message:

Add some tests for the contactadminform.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/branches/henrik-contactforms/src/waeup/sirp/browser/browser.txt

    r5408 r5430  
    7272  Content-Type: text/xml; charset=UTF-8
    7373  X-Powered-By: Zope (www.zope.org), Python (www.python.org)
     74
     75Contact Form
     76============
     77
     78Let's enter the contact form::
     79
     80  >>> browser.open('http://localhost/myuniversity/contactadmin')
     81  >>> print browser.contents
     82  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     83  ...<h2>Contact</h2>
     84  ...
     85
     86We fill in a wrong email adress::
     87
     88  >>> browser.getControl(name='email').value = "xx@yy"
     89  >>> browser.getControl(name='descr').value = "test message"
     90  >>> browser.getControl('Submit').click()
     91  >>> print browser.contents     
     92  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     93  ...<li class="message">Error: xx@yy is not a valid email address!</li>
     94  ...
     95
     96Now we fill the form properly::
     97
     98  >>> browser.getControl(name='email').value = "xx@yy.zz"
     99  >>> browser.getControl(name='descr').value = "test message"
     100  >>> browser.getControl('Submit').click()
     101  >>> print browser.contents     
     102  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     103  ...<li class="message">Your message has been sent.</li>
     104  ...
    74105
    75106
Note: See TracChangeset for help on using the changeset viewer.