source: trunk/tests/testUsers.py @ 3259

Revision 2711, 2.1 KB checked in by jukka, 11 years ago (diff)

Errors in tests fixed, but still 23 Failures.

  • 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
32USER_PROPERTIES = ['First name', 'Last name', 'Email address', 'Phone', 'SMS', 'Instant messengers', 'Country', 'City or area','Homepage','Languages','Skills','Interests','Subject area','Biography','E-mail announcements','Portrait']
33
34class TestUsers(LeMillTestCase,Functional):
35    """
36    Test suite for verifying user functionality.
37    """
38
39    def testPersonalizeForm(self):
40        self.addUser('test1','passwd1')
41        auth="test1:passwd1"
42        self.login('test1')
43        result=self.publish(self.portal.absolute_url_path()+'/community/people/test1/personalize_form', basic=auth)
44        body=result.getBody()
45        for prop in USER_PROPERTIES:
46            self.failUnless(body.find(prop) != -1, "personalize_form broken, property %s not found" % prop)
47     
48
49def test_suite():
50    from unittest import TestSuite, makeSuite
51    suite = TestSuite()
52    suite.addTest(makeSuite(TestUsers))
53    return suite
54
55if __name__ == '__main__':
56    framework()
Note: See TracBrowser for help on using the repository browser.