source: trunk/tests/testUsers.py @ 1878

Revision 1878, 2.1 KB checked in by jukka, 12 years ago (diff)

Fixed a test.

  • Property svn:eol-style set to native
Line 
1# Copyright 2006 by the LeMill Team (see AUTHORS)
2#
3# This file is part of LeMill.
4#
5# LeMill is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# LeMill is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with LeMill; if not, write to the Free Software
17# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
19import os, sys, re
20if __name__ == '__main__':
21    execfile(os.path.join(sys.path[0], 'framework.py'))
22
23from Testing import ZopeTestCase
24from LeMillTestCase import LeMillTestCase
25from Testing.ZopeTestCase.functional import Functional
26
27from Products.LeMill.config import *
28from Products.PloneTestCase.setup import portal_owner, default_password
29
30auth=':'.join((portal_owner, default_password))
31
32class TestUsers(LeMillTestCase,Functional):
33    """
34    Test suite for verifying user functionality.
35    """
36
37    def testUserProperties(self):
38        for prop in MEMBER_PROPERTIES:
39            self.failUnless(self.portal.portal_memberdata.hasProperty(prop[0]),"Property %s not found in user data: %s" % (prop,str(self.portal.portal_memberdata.propertyItems())))
40
41
42    def testPersonalizeForm(self):
43        self.addUser('test1','passwd1')
44        auth="test1:passwd1"
45        self.login('test1')
46        result=self.publish(self.portal.absolute_url_path()+'/test1/personalize_form', basic=auth)
47        body=result.getBody()
48        for prop in MEMBER_PROPERTIES:
49            if not prop[2]=="hidden":
50                self.failUnless(body.find(prop[0]) != -1, "personalize_form broken, property %s not found" % prop[0] + body)
51     
52
53def test_suite():
54    from unittest import TestSuite, makeSuite
55    suite = TestSuite()
56    suite.addTest(makeSuite(TestUsers))
57    return suite
58
59if __name__ == '__main__':
60    framework()
Note: See TracBrowser for help on using the repository browser.