## $Id: test_faculty.py 7195 2011-11-25 07:34:07Z henrik $
##
## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##

# Test faculties
import tempfile
import shutil
import unittest
from zope.interface.verify import verifyObject, verifyClass
from waeup.sirp.university import Faculty
from waeup.sirp.university.interfaces import IFaculty

class FacultyTests(unittest.TestCase):

    def test_ifaces(self):
        # Make sure we implement the promised interfaces
        fac = Faculty()
        verifyClass(IFaculty, Faculty)
        verifyObject(IFaculty, fac)
        return

    def test_longtitle(self):
        # Make sure we get a longtitle
        fac = Faculty()
        self.assertEqual(fac.longtitle(),
                         u'Faculty of Unnamed Faculty (NA)')

    def test_longtitle_no_terms(self):
        # Make sure we get a longtitle also if no term for the title
        # prefix is available
        fac = Faculty()
        fac.title_prefix = 'Studio for' # Not a valid prefix
        self.assertEqual(fac.longtitle(),
                         u'Unnamed Faculty (NA)')
