source: main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_browser.py @ 15704

Last change on this file since 15704 was 15696, checked in by Henrik Bettermann, 5 years ago

Print signatures on course registration slip.

Configure bank account.

  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1## $Id: test_browser.py 15696 2019-10-20 20:06:20Z 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##
18import os
19import shutil
20import tempfile
21from StringIO import StringIO
22from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo
23from zope.securitypolicy.interfaces import IPrincipalRoleManager
24from zope.component.hooks import setSite, clearSite
25from zope.component import getUtility, createObject
26from zope.interface import verify
27from zope.event import notify
28from waeup.kofa.authentication import LocalRoleSetEvent
29from waeup.kofa.app import University
30from waeup.kofa.students.tests.test_browser import StudentsFullSetup
31from waeup.kofa.students.accommodation import BedTicket
32from waeup.kofa.testing import FunctionalTestCase
33from waeup.kofa.browser.tests.test_pdf import samples_dir
34from waeup.kofa.interfaces import (
35    IExtFileStore, IFileStoreNameChooser)
36from waeup.kofa.students.interfaces import IStudentsUtils
37from kofacustom.iuokada.testing import FunctionalLayer
38
39
40class StudentsContainerUITests(StudentsFullSetup):
41    # Tests for StudentsContainer class views and pages
42
43    layer = FunctionalLayer
44
45    def test_dummytest(self):
46        return
47
48
49class StudentUITests(StudentsFullSetup):
50    # Tests for Student class views and pages
51
52    layer = FunctionalLayer
53
54    def test_student_course_registration(self):
55        IWorkflowState(self.student).setState('school fee paid')
56        self.browser.open(self.login_path)
57        self.browser.getControl(name="form.login").value = self.student_id
58        self.browser.getControl(name="form.password").value = 'spwd'
59        self.browser.getControl("Login").click()
60        # Now students can add the current study level
61        self.browser.getLink("Study Course").click()
62        self.browser.getLink("Add course list").click()
63        self.assertMatches('...Add current level 100 (Year 1)...',
64                           self.browser.contents)
65        self.browser.getControl("Create course list now").click()
66        # Students can open the pdf course registration slip
67        self.browser.open(
68            self.student_path + '/studycourse/100/course_registration_slip.pdf')
69        self.assertEqual(self.browser.headers['Status'], '200 Ok')
70        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
71        path = os.path.join(samples_dir(), 'course_registration_slip.pdf')
72        open(path, 'wb').write(self.browser.contents)
73        print "Sample PDF course_registration_slip.pdf written to %s" % path
Note: See TracBrowser for help on using the repository browser.