comparison test/test_cgi.py @ 1431:c70068162e64

Altered Class.create() and FileClass.create() methods... ...to make "content" property available in auditors Added "author" and "date" props to messages created by ":note". It might be useful to keep that alive as a convenience variable.
author Richard Jones <richard@users.sourceforge.net>
date Fri, 14 Feb 2003 00:31:46 +0000
parents 58ce2c1614cd
children 13c42b803101
comparison
equal deleted inserted replaced
1430:1159963f769c 1431:c70068162e64
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_cgi.py,v 1.8 2003-02-13 07:38:34 richard Exp $ 11 # $Id: test_cgi.py,v 1.9 2003-02-14 00:31:46 richard Exp $
12 12
13 import unittest, os, shutil, errno, sys, difflib, cgi 13 import unittest, os, shutil, errno, sys, difflib, cgi
14 14
15 from roundup.cgi import client 15 from roundup.cgi import client
16 from roundup import init, instance, password, hyperdb, date 16 from roundup import init, instance, password, hyperdb, date
386 {'test-1@:link:link': 'blah'}) 386 {'test-1@:link:link': 'blah'})
387 self.assertRaises(ValueError, self.parseForm, 387 self.assertRaises(ValueError, self.parseForm,
388 {'test-1@:link:link': 'issue'}) 388 {'test-1@:link:link': 'issue'})
389 389
390 def testBackwardsCompat(self): 390 def testBackwardsCompat(self):
391 self.assertEqual(self.parseForm({':note': 'spam'}, 'issue'), 391 res = self.parseForm({':note': 'spam'}, 'issue')
392 ({('issue', None): {}, ('msg', '-1'): {'content': 'spam'}}, 392 date = res[0][('msg', '-1')]['date']
393 self.assertEqual(res, ({('issue', None): {}, ('msg', '-1'):
394 {'content': 'spam', 'author': '1', 'date': date}},
393 [('issue', None, 'messages', [('msg', '-1')])])) 395 [('issue', None, 'messages', [('msg', '-1')])]))
394 file = FileUpload('foo', 'foo.txt') 396 file = FileUpload('foo', 'foo.txt')
395 self.assertEqual(self.parseForm({':file': file}, 'issue'), 397 self.assertEqual(self.parseForm({':file': file}, 'issue'),
396 ({('issue', None): {}, ('file', '-1'): {'content': 'foo', 398 ({('issue', None): {}, ('file', '-1'): {'content': 'foo',
397 'name': 'foo.txt', 'type': 'text/plain'}}, 399 'name': 'foo.txt', 'type': 'text/plain'}},

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