source: trunk/tests/testActivity.py @ 47

Revision 47, 1.3 KB checked in by tarmo, 14 years ago (diff)

Converted all line feeds to LF and added the svn:eol-style
property to keep the line feeds in LF. When adding new text files,
run the command "svn propset svn:eol-style LF [FILE]" to set the
property.

  • Property svn:eol-style set to LF
Line 
1#
2# Test case for Activity content
3#
4
5import os, sys, re
6if __name__ == '__main__':
7    execfile(os.path.join(sys.path[0], 'framework.py'))
8
9from Testing import ZopeTestCase
10from Testing.ZopeTestCase.functional import Functional
11from ToolboxTestCase import ToolboxTestCase
12from Products.Toolbox.Activity import Activity
13from Products.Archetypes.public import PrimaryFieldMarshaller
14
15types = ('Activity',)
16
17class TestActivity(ToolboxTestCase,Functional):
18
19    def afterSetUp(self):
20        self.content = self.construct('Activity', 'TestActivity', self.folder)
21
22    def testExistence(self):
23        for pt in types:
24            ob = self.construct(pt,pt,self.folder)
25            self.failUnlessEqual(ob._getPortalTypeName(),pt)
26            self.failUnlessEqual(ob.portal_type,pt)
27   
28    def testEditing(self):
29        ID='casestudy'
30        testTitle='Test'
31    testAuthor='Author'
32        testBody='heading'
33        ob=self.construct('Activity', ID ,self.folder)
34        ob.edit(title=testTitle, author=testAuthor, body=testBody)
35        self.assertEqual(ob.Title(), testTitle)
36    self.assertEqual(ob.getAuthor(), testAuthor)
37        self.assertEqual(ob.getBody(), testBody)
38   
39
40def test_suite():
41    from unittest import TestSuite, makeSuite
42    suite = TestSuite()
43    suite.addTest(makeSuite(TestActivity))
44    return suite
45
46if __name__ == '__main__':
47    framework()
Note: See TracBrowser for help on using the repository browser.