1 | ## $Id: test_browser.py 10929 2014-01-15 12:50:07Z henrik $ |
---|
2 | ## |
---|
3 | ## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann |
---|
4 | ## This program is free software; you can redistribute it and/or modify |
---|
5 | ## it under the terms of the GNU General Public License as published by |
---|
6 | ## the Free Software Foundation; either version 2 of the License, or |
---|
7 | ## (at your option) any later version. |
---|
8 | ## |
---|
9 | ## This program is distributed in the hope that it will be useful, |
---|
10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | ## GNU General Public License for more details. |
---|
13 | ## |
---|
14 | ## You should have received a copy of the GNU General Public License |
---|
15 | ## along with this program; if not, write to the Free Software |
---|
16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
17 | ## |
---|
18 | import grok |
---|
19 | from zope.event import notify |
---|
20 | from zope.component import createObject, getUtility |
---|
21 | from waeup.aaue.testing import FunctionalLayer |
---|
22 | from waeup.kofa.applicants.tests.test_browser import ( |
---|
23 | ApplicantsFullSetup, container_name_1) |
---|
24 | |
---|
25 | class CustomApplicantUITest(ApplicantsFullSetup): |
---|
26 | """Perform some browser tests. |
---|
27 | """ |
---|
28 | |
---|
29 | layer = FunctionalLayer |
---|
30 | |
---|
31 | def test_show_credentials_on_landing_page(self): |
---|
32 | # An applicant can register himself. |
---|
33 | self.applicant.reg_number = u'1234' |
---|
34 | notify(grok.ObjectModifiedEvent(self.applicant)) |
---|
35 | self.browser.open('http://localhost/app/applicants/%s/' % container_name_1) |
---|
36 | self.browser.getLink("Register for application").click() |
---|
37 | # Fill the edit form with suitable values |
---|
38 | self.browser.getControl(name="form.firstname").value = 'Klaus' |
---|
39 | self.browser.getControl(name="form.lastname").value = 'Lutz' |
---|
40 | self.browser.getControl(name="form.email").value = 'xx@yy.zz' |
---|
41 | self.browser.getControl("Send login credentials").click() |
---|
42 | self.assertMatches('...Your registration was successful...', |
---|
43 | self.browser.contents) |
---|
44 | self.assertTrue('<td>Password:</td>' in self.browser.contents) |
---|
45 | return |
---|