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
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
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
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'
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'
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 )
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)