|
8 | 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 | 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
10 | 10 | # |
11 | | -# $Id: test_cgi.py,v 1.35 2008-08-07 05:59:18 richard Exp $ |
| 11 | +# $Id: test_cgi.py,v 1.36 2008-08-07 06:12:57 richard Exp $ |
12 | 12 |
|
13 | 13 | import unittest, os, shutil, errno, sys, difflib, cgi, re |
14 | 14 |
|
@@ -77,7 +77,7 @@ def setUp(self): |
77 | 77 | string=hyperdb.String(), number=hyperdb.Number(), |
78 | 78 | boolean=hyperdb.Boolean(), link=hyperdb.Link('test'), |
79 | 79 | multilink=hyperdb.Multilink('test'), date=hyperdb.Date(), |
80 | | - interval=hyperdb.Interval()) |
| 80 | + messages=hyperdb.Multilink('msg'), interval=hyperdb.Interval()) |
81 | 81 |
|
82 | 82 | # compile the labels re |
83 | 83 | classes = '|'.join(self.db.classes.keys()) |
@@ -574,6 +574,18 @@ def testLinking(self): |
574 | 574 | ) |
575 | 575 | ) |
576 | 576 |
|
| 577 | + def testMessages(self): |
| 578 | + self.assertEqual(self.parseForm({ |
| 579 | + 'msg-1@content': 'asdf', |
| 580 | + 'msg-2@content': 'qwer', |
| 581 | + '@link@messages': 'msg-1, msg-2'}), |
| 582 | + ({('test', None): {}, |
| 583 | + ('msg', '-2'): {'content': 'qwer'}, |
| 584 | + ('msg', '-1'): {'content': 'asdf'}}, |
| 585 | + [('test', None, 'messages', [('msg', '-1'), ('msg', '-2')])] |
| 586 | + ) |
| 587 | + ) |
| 588 | + |
577 | 589 | def testLinkBadDesignator(self): |
578 | 590 | self.assertRaises(FormError, self.parseForm, |
579 | 591 | {'test-1@link@link': 'blah'}) |
|
0 commit comments