source: main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_utils.py @ 16012

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

Remove some fields from CustomStudentBaseManageFormPage?.

Change headings.

File size: 1.7 KB
Line 
1## $Id: test_utils.py 15763 2019-11-07 06:39:29Z 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 grok
19from hurry.workflow.interfaces import IWorkflowState
20from zope.component import getUtility, createObject
21from waeup.kofa.students.studylevel import StudentStudyLevel
22from waeup.kofa.students.tests.test_browser import StudentsFullSetup
23from waeup.kofa.students.interfaces import IStudentsUtils
24from waeup.kofa.students.studylevel import StudentStudyLevel
25from kofacustom.iuokada.testing import FunctionalLayer
26
27class StudentsUtilsTests(StudentsFullSetup):
28
29    layer = FunctionalLayer
30
31    def test_setMatricNumber(self):
32        IWorkflowState(self.student).setState('school fee paid')
33        site = grok.getSite()
34        utils = getUtility(IStudentsUtils)
35        site['configuration'].next_matric_integer = 21305
36        self.student.matric_number = None
37        msg, mnumber = utils.setMatricNumber(self.student)
38        self.assertEqual(self.student.matric_number, '04/021305')
39        self.assertEqual(msg, None)
40        return
Note: See TracBrowser for help on using the repository browser.