1 | ## $Id: test_browser.py 10589 2013-09-05 12:35:14Z henrik $ |
---|
2 | ## |
---|
3 | ## Copyright (C) 2013 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 | """ |
---|
19 | Test the applicant-related UI components. |
---|
20 | """ |
---|
21 | from waeup.uniben.testing import FunctionalLayer |
---|
22 | from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup |
---|
23 | |
---|
24 | class CustomApplicantUITests(ApplicantsFullSetup): |
---|
25 | # Tests for uploading/browsing the passport image of appplicants |
---|
26 | |
---|
27 | layer = FunctionalLayer |
---|
28 | |
---|
29 | def test_applicant_access(self): |
---|
30 | # Anonymous users can't see the application fee. |
---|
31 | self.browser.open(self.container_path) |
---|
32 | self.assertFalse('Application Fee' in self.browser.contents) |
---|
33 | # Applicants can edit their record |
---|
34 | self.browser.open(self.login_path) |
---|
35 | self.login() |
---|
36 | self.assertTrue( |
---|
37 | 'You logged in.' in self.browser.contents) |
---|
38 | self.browser.open(self.edit_path) |
---|
39 | self.assertTrue(self.browser.url != self.login_path) |
---|
40 | self.assertEqual(self.browser.headers['Status'], '200 Ok') |
---|
41 | self.fill_correct_values() |
---|
42 | self.browser.getControl("Save").click() |
---|
43 | self.assertMatches('...Form has been saved...', self.browser.contents) |
---|
44 | # Applicants can't see the application fee. |
---|
45 | self.browser.open(self.container_path) |
---|
46 | self.assertFalse('Application Fee' in self.browser.contents) |
---|
47 | return |
---|
48 | |
---|