Skip to content

Commit 88900fc

Browse files
author
Richard Jones
committed
add new test for multiple message creation
1 parent 02c8a79 commit 88900fc

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

test/test_cgi.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# but WITHOUT ANY WARRANTY; without even the implied warranty of
99
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1010
#
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 $
1212

1313
import unittest, os, shutil, errno, sys, difflib, cgi, re
1414

@@ -77,7 +77,7 @@ def setUp(self):
7777
string=hyperdb.String(), number=hyperdb.Number(),
7878
boolean=hyperdb.Boolean(), link=hyperdb.Link('test'),
7979
multilink=hyperdb.Multilink('test'), date=hyperdb.Date(),
80-
interval=hyperdb.Interval())
80+
messages=hyperdb.Multilink('msg'), interval=hyperdb.Interval())
8181

8282
# compile the labels re
8383
classes = '|'.join(self.db.classes.keys())
@@ -574,6 +574,18 @@ def testLinking(self):
574574
)
575575
)
576576

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+
577589
def testLinkBadDesignator(self):
578590
self.assertRaises(FormError, self.parseForm,
579591
{'test-1@link@link': 'blah'})

0 commit comments

Comments
 (0)