source: main/waeup.sirp/trunk/src/waeup/sirp/applicants/jambtables/tests/test_util.py @ 5772

Last change on this file since 5772 was 5761, checked in by uli, 14 years ago

Fix import.

File size: 2.1 KB
Line 
1##
2## test_util.py
3## Login : <uli@pu.smp.net>
4## Started on  Sun Aug 22 19:56:52 2010 Uli Fouquet
5## $Id$
6##
7## Copyright (C) 2010 Uli Fouquet
8## This program is free software; you can redistribute it and/or modify
9## it under the terms of the GNU General Public License as published by
10## the Free Software Foundation; either version 2 of the License, or
11## (at your option) any later version.
12##
13## This program is distributed in the hope that it will be useful,
14## but WITHOUT ANY WARRANTY; without even the implied warranty of
15## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16## GNU General Public License for more details.
17##
18## You should have received a copy of the GNU General Public License
19## along with this program; if not, write to the Free Software
20## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21##
22"""Tests for jambtables and applicants helper tools.
23"""
24import unittest
25from zope.component.hooks import setSite
26from zope.site import LocalSiteManager
27from zope.site.folder import Folder
28from zope.site.testing import siteSetUp, siteTearDown
29from waeup.sirp.applicants.tests.test_authentication import (
30    FakeSite)
31from waeup.sirp.applicants.jambtables.util import (
32    application_exists, get_applicant_data
33    )
34
35class HelperToolsTest(unittest.TestCase):
36
37    def setUp(self):
38        self.root = Folder()
39        siteSetUp(self.root)
40        self.app = FakeSite() #grok.Application()
41        self.root['app'] = self.app
42        self.app.setSiteManager(LocalSiteManager(self.app))
43        setSite(self.app)
44        return
45
46    def tearDown(self):
47        siteTearDown()
48        return
49
50    def test_application_exists(self):
51        result = application_exists('APP-99999')
52        assert result is False
53
54        result = application_exists('APP-44444')
55        assert result is True
56       
57        return
58
59def test_suite():
60    suite = unittest.TestSuite()
61    for testcase in [
62        HelperToolsTest,
63        ]:
64        suite.addTest(unittest.TestLoader().loadTestsFromTestCase(
65                testcase
66                )
67        )
68    return suite
Note: See TracBrowser for help on using the repository browser.