comparison test/test_htmltemplate.py @ 722:431c3f9c8ac9

ehem and the unit test
author Richard Jones <richard@users.sourceforge.net>
date Wed, 15 May 2002 06:37:31 +0000
parents bc46480e2a2b
children 9a17342a9e04
comparison
equal deleted inserted replaced
721:c63b71a949a8 722:431c3f9c8ac9
6 # 6 #
7 # This module is distributed in the hope that it will be useful, 7 # This module is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 # 10 #
11 # $Id: test_htmltemplate.py,v 1.13 2002-04-03 05:54:31 richard Exp $ 11 # $Id: test_htmltemplate.py,v 1.14 2002-05-15 06:37:31 richard Exp $
12 12
13 import unittest, cgi, time 13 import unittest, cgi, time
14 14
15 from roundup import date, password 15 from roundup import date, password
16 from roundup.htmltemplate import TemplateFunctions 16 from roundup.htmltemplate import TemplateFunctions
267 self.assertEqual(self.tf.do_reldate('link'), s) 267 self.assertEqual(self.tf.do_reldate('link'), s)
268 self.assertEqual(self.tf.do_reldate('multilink'), s) 268 self.assertEqual(self.tf.do_reldate('multilink'), s)
269 269
270 def testReldate_date(self): 270 def testReldate_date(self):
271 self.assertEqual(self.tf.do_reldate('reldate'), '- 2y 1m') 271 self.assertEqual(self.tf.do_reldate('reldate'), '- 2y 1m')
272 date = self.tf.cl.get('1', 'reldate') 272 interval = date.Interval('- 2y 1m')
273 self.assertEqual(self.tf.do_reldate('reldate', pretty=1), date.pretty()) 273 self.assertEqual(self.tf.do_reldate('reldate', pretty=1),
274 interval.pretty())
274 275
275 # def do_download(self, property): 276 # def do_download(self, property):
276 def testDownload_novalue(self): 277 def testDownload_novalue(self):
277 self.assertEqual(self.tf.do_download('novalue'), 278 self.assertEqual(self.tf.do_download('novalue'),
278 _('[no %(propname)s]')%{'propname':'novalue'.capitalize()}) 279 _('[no %(propname)s]')%{'propname':'novalue'.capitalize()})
350 return unittest.makeSuite(NodeCase, 'test') 351 return unittest.makeSuite(NodeCase, 'test')
351 352
352 353
353 # 354 #
354 # $Log: not supported by cvs2svn $ 355 # $Log: not supported by cvs2svn $
356 # Revision 1.13 2002/04/03 05:54:31 richard
357 # Fixed serialisation problem by moving the serialisation step out of the
358 # hyperdb.Class (get, set) into the hyperdb.Database.
359 #
360 # Also fixed htmltemplate after the showid changes I made yesterday.
361 #
362 # Unit tests for all of the above written.
363 #
355 # Revision 1.12 2002/03/29 19:41:48 rochecompaan 364 # Revision 1.12 2002/03/29 19:41:48 rochecompaan
356 # . Fixed display of mutlilink properties when using the template 365 # . Fixed display of mutlilink properties when using the template
357 # functions, menu and plain. 366 # functions, menu and plain.
358 # 367 #
359 # Revision 1.11 2002/02/21 23:11:45 richard 368 # Revision 1.11 2002/02/21 23:11:45 richard

Roundup Issue Tracker: http://roundup-tracker.org/