comparison test/test_cgi.py @ 3904:91008ec8f9a0

retire "topic" usage "Topic" still appears in the locale files. I'm sure we need to support that for existing trackers. I *think* they don't care about any of the other changes that have been made. I also left Ka-Ping Yee's original design document unchanged. This takes care of sf feature request [SF#953161]
author Justus Pendleton <jpend@users.sourceforge.net>
date Sun, 16 Sep 2007 02:45:11 +0000
parents 21420ba64b0d
children 1b84355e346a
comparison
equal deleted inserted replaced
3903:a90fa2e08a0a 3904:91008ec8f9a0
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.31 2007-09-12 21:11:14 jpend Exp $ 11 # $Id: test_cgi.py,v 1.32 2007-09-16 02:45:11 jpend Exp $
12 12
13 import unittest, os, shutil, errno, sys, difflib, cgi, re 13 import unittest, os, shutil, errno, sys, difflib, cgi, re
14 14
15 from roundup.cgi import client 15 from roundup.cgi import client
16 from roundup.cgi.exceptions import FormError 16 from roundup.cgi.exceptions import FormError
211 def testStringMultilinkId(self): 211 def testStringMultilinkId(self):
212 id = self.db.keyword.create(name='2') 212 id = self.db.keyword.create(name='2')
213 self.assertEqual(id,'1') 213 self.assertEqual(id,'1')
214 id = self.db.keyword.create(name='1') 214 id = self.db.keyword.create(name='1')
215 self.assertEqual(id,'2') 215 self.assertEqual(id,'2')
216 issue = self.db.issue.create(title='i1-status1', topic=['1']) 216 issue = self.db.issue.create(title='i1-status1', keyword=['1'])
217 self.assertEqual(self.db.issue.get(issue,'topic'),['1']) 217 self.assertEqual(self.db.issue.get(issue,'keyword'),['1'])
218 self.assertEqual(self.db.keyword.lookup('1'),'2') 218 self.assertEqual(self.db.keyword.lookup('1'),'2')
219 self.assertEqual(self.db.keyword.lookup('2'),'1') 219 self.assertEqual(self.db.keyword.lookup('2'),'1')
220 form = cgi.FieldStorage() 220 form = cgi.FieldStorage()
221 cl = client.Client(self.instance, None, {'PATH_INFO':'/'}, form) 221 cl = client.Client(self.instance, None, {'PATH_INFO':'/'}, form)
222 cl.classname = 'issue' 222 cl.classname = 'issue'
223 cl.nodeid = issue 223 cl.nodeid = issue
224 cl.db = self.db 224 cl.db = self.db
225 cl.userid = '1' 225 cl.userid = '1'
226 item = HTMLItem(cl, 'issue', issue) 226 item = HTMLItem(cl, 'issue', issue)
227 for topic in item.topic: 227 for keyword in item.keyword:
228 self.assertEqual(topic.id, '1') 228 self.assertEqual(keyword.id, '1')
229 self.assertEqual(topic.name, '2') 229 self.assertEqual(keyword.name, '2')
230 230
231 def testFileUpload(self): 231 def testFileUpload(self):
232 file = FileUpload('foo', 'foo.txt') 232 file = FileUpload('foo', 'foo.txt')
233 self.assertEqual(self.parseForm({'content': file}, 'file'), 233 self.assertEqual(self.parseForm({'content': file}, 'file'),
234 ({('file', None): {'content': 'foo', 'name': 'foo.txt', 234 ({('file', None): {'content': 'foo', 'name': 'foo.txt',

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