<badtag>
<badtag>\njavascript:badcode
\nA string with cmeerw@example.com embedded \u00df
\nA string with cmeerw@example.com embedded \u00df
\n')) def test_string_field(self): p = StringHTMLProperty(self.client, 'test', '1', None, 'test', 'A string with rouilj@example.com embedded < html') self.assertEqual(p.field(), '') def test_string_multiline(self): p = StringHTMLProperty(self.client, 'test', '1', None, 'test', 'A string with rouilj@example.com embedded < html') self.assertEqual(p.multiline(), '') self.assertEqual(p.multiline(rows=300, cols=100, **{'class':'css_class'}), '') def test_url_match(self): '''Test the URL regular expression in StringHTMLProperty. ''' def t(s, nothing=False, **groups): m = StringHTMLProperty.hyper_re.search(s) if nothing: if m: self.assertEqual(m, None, '%r matched (%r)'%(s, m.groupdict())) return else: self.assertNotEqual(m, None, '%r did not match'%s) d = m.groupdict() for g in groups: self.assertEqual(d[g], groups[g], '%s %r != %r in %r'%(g, d[g], groups[g], s)) #t('123.321.123.321', 'url') t('http://localhost/', url='http://localhost/') t('http://roundup.net/', url='http://roundup.net/') t('http://richard@localhost/', url='http://richard@localhost/') t('http://richard:sekrit@localhost/', url='http://richard:sekrit@localhost/') t('A string with <br> embedded \u00df
')) def test_string_markdown_link(self): p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'A linkA link http://localhost
')) def test_string_markdown_link(self): # markdown2 and markdown escape the email address try: from html import unescape as html_unescape except ImportError: from HTMLParser import HTMLParser html_unescape = HTMLParser().unescape p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'A linkA link cmeerw@example.com
')) def test_string_markdown_javascript_link(self): # make sure we don't get a "javascript:" link p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'embedded code block
\nline 1\nline 2\n\nnew paragraph
')) @skip_mistune class MistuneTestCase(TemplatingTestCase, MarkdownTests) : def setUp(self): TemplatingTestCase.setUp(self) from roundup.cgi import templating self.__markdown = templating.markdown templating.markdown = templating._import_mistune() def tearDown(self): from roundup.cgi import templating templating.markdown = self.__markdown @skip_markdown2 class Markdown2TestCase(TemplatingTestCase, MarkdownTests) : def setUp(self): TemplatingTestCase.setUp(self) from roundup.cgi import templating self.__markdown = templating.markdown templating.markdown = templating._import_markdown2() def tearDown(self): from roundup.cgi import templating templating.markdown = self.__markdown @skip_markdown class MarkdownTestCase(TemplatingTestCase, MarkdownTests) : def setUp(self): TemplatingTestCase.setUp(self) from roundup.cgi import templating self.__markdown = templating.markdown templating.markdown = templating._import_markdown() def tearDown(self): from roundup.cgi import templating templating.markdown = self.__markdown class NoMarkdownTestCase(TemplatingTestCase) : def setUp(self): TemplatingTestCase.setUp(self) from roundup.cgi import templating self.__markdown = templating.markdown templating.markdown = None def tearDown(self): from roundup.cgi import templating templating.markdown = self.__markdown def test_string_markdown(self): p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'A string http://localhost with cmeerw@example.com