annotate test/test_textfmt.py @ 3859:9e48fda4a41c

Added two new tests for Links and Multilinks in HTMLItems: An Item, when dereferencing a Link or Multilink should return the correct items from the database. Now if we name the linked items with numeric names (in the Link example we have a status with id='1' and name='2' and vice-versa, in the Multilink example we have the same for keyword) and the property 'name' of these items is also the key, it still works for Links but not for Multilinks: The multilink in this case returns the keyword with the *name* '1', not the one with the *id* '1'. I consider this a bug and have implemented the test before looking deeper into it...
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Thu, 05 Jul 2007 19:21:57 +0000
parents f35ece8f8ff7
children 364c54991861
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3644
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
1 import unittest
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
2
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
3 from roundup.support import wrap
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
4
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
5 class WrapTestCase(unittest.TestCase):
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
6 def testWrap(self):
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
7 lorem = '''Lorem ipsum dolor sit amet, consectetuer adipiscing elit.'''
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
8 wrapped = '''Lorem ipsum dolor
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
9 sit amet,
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
10 consectetuer
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
11 adipiscing elit.'''
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
12 self.assertEquals(wrap(lorem, 20), wrapped)
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
13
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
14 def test_suite():
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
15 suite = unittest.TestSuite()
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
16 suite.addTest(unittest.makeSuite(WrapTestCase))
f35ece8f8ff7 added StringHTMLProperty wrapped() method to wrap long lines in issue display
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
17 return suite

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