Example #1
0
 def test_UpperedHtml(self):
     d = NewsItem('foo')
     d.edit(text_format='', description='bar', text=string.upper(BASIC_HTML))
     assert d.Format() == 'text/html'
     assert d.title == 'TITLE IN TAG'
     assert string.find(d.text, '</BODY') == -1
     assert d.Description() == 'DESCRIBE ME'
     assert len(d.Contributors()) == 2
Example #2
0
 def test_StructuredText(self):
     d = NewsItem('foo')
     d.edit(text_format='structured-text', description='bar'
           , text=BASIC_STRUCTUREDTEXT)
     
     assert d.Format() == 'text/plain'
     assert d.Title() == 'My NewsItem'
     assert d.Description() == 'A news item by me'
     assert len(d.Contributors()) == 3
     assert string.find(d.cooked_text, '<p>') >= 0
Example #3
0
 def test_UpperedHtml(self):
     d = NewsItem('foo')
     d.edit(text_format='',
            description='bar',
            text=string.upper(BASIC_HTML))
     assert d.Format() == 'text/html'
     assert d.title == 'TITLE IN TAG'
     assert string.find(d.text, '</BODY') == -1
     assert d.Description() == 'DESCRIBE ME'
     assert len(d.Contributors()) == 2
Example #4
0
    def test_StructuredText(self):
        d = NewsItem('foo')
        d.edit(text_format='structured-text',
               description='bar',
               text=BASIC_STRUCTUREDTEXT)

        assert d.Format() == 'text/plain'
        assert d.Title() == 'My NewsItem'
        assert d.Description() == 'A news item by me'
        assert len(d.Contributors()) == 3
        assert string.find(d.cooked_text, '<p>') >= 0
Example #5
0
 def test_HtmlWithoutNewlines(self):
     d = NewsItem('foo')
     html = string.join(string.split(BASIC_HTML, '\n'), '')
     d.edit(text_format='', description='bar', text=html)
     assert d.Format() == 'text/html'
     assert d.Description() == 'Describe me'
Example #6
0
 def test_HtmlWithDoctype(self):
     d = NewsItem('foo')
     html = '%s\n%s' % (DOCTYPE, BASIC_HTML)
     d.edit(text_format='', description='bar', text=html)
     assert d.Description() == 'Describe me'
Example #7
0
 def test_EntityInTitle(self):
     d = NewsItem('foo')
     d.edit(text_format='html', description='bar', text=ENTITY_IN_TITLE)
     assert d.title == '&Auuml;rger', "Title '%s' being lost" % (
         d.title )
Example #8
0
 def test_HtmlWithoutNewlines(self):
     d = NewsItem('foo')
     html = string.join(string.split(BASIC_HTML, '\n'), '')
     d.edit(text_format='', description='bar', text=html)
     assert d.Format() == 'text/html'
     assert d.Description() == 'Describe me'
Example #9
0
 def test_HtmlWithDoctype(self):
     d = NewsItem('foo')
     html = '%s\n%s' % (DOCTYPE, BASIC_HTML)
     d.edit(text_format='', description='bar', text=html)
     assert d.Description() == 'Describe me'
Example #10
0
 def test_EntityInTitle(self):
     d = NewsItem('foo')
     d.edit(text_format='html', description='bar', text=ENTITY_IN_TITLE)
     assert d.title == '&Auuml;rger', "Title '%s' being lost" % (d.title)