source: trunk/tests/testTool.py @ 55

Revision 55, 1.2 KB checked in by laszlo, 14 years ago (diff)

closes #151 spent 10m

Line 
1#
2# Test case for Asset 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.BaseAsset import BaseAsset
13from Products.Archetypes.public import PrimaryFieldMarshaller
14
15class TestTool(ToolboxTestCase,Functional):
16
17    def afterSetUp(self):
18        pass
19
20    def testEditing(self):
21        LOCATION='url'
22        ADDRESS='Test Address'
23        DESCRIPTION = 'Test description'
24        TAGS = 'Test tags'
25        ob=self.construct('Tool', 'TestTool' ,self.folder)
26        ob.edit(location=LOCATION, address=ADDRESS, description=DESCRIPTION, tags=TAGS)
27        self.failUnless(LOCATION in ob.getLocation())
28        self.assertEqual(ob.getAddress(), ADDRESS)
29        self.assertEqual(ob.getDescription(), '<p>' + DESCRIPTION + '</p>')
30        self.failUnless(TAGS in ob.getTags())       
31   
32def test_suite():
33    from unittest import TestSuite, makeSuite
34    suite = TestSuite()
35    suite.addTest(makeSuite(TestTool))
36    return suite
37
38if __name__ == '__main__':
39    framework()
Note: See TracBrowser for help on using the repository browser.