Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(7)  |  Derive(0)  |  Import(2)

src/m/e/mediadrop-HEAD/mediadrop/controllers/errors.py   mediadrop(Download)
from mediadrop.lib.base import BaseController
from mediadrop.lib.decorators import expose, observable
from mediadrop.lib.helpers import redirect, clean_xhtml
from mediadrop.lib.i18n import _
from mediadrop.plugin import events
 
        message = request.params.get('message', default_message)
        message = clean_xhtml(message)
 
        return dict(

src/m/e/mediadrop-HEAD/mediadrop/lib/tests/xhtml_normalization_test.py   mediadrop(Download)
# See LICENSE.txt in the main project directory, for more information.
 
from mediadrop.lib.helpers import clean_xhtml, line_break_xhtml
from mediadrop.lib.test.pythonic_testcase import *
 
 
class XHTMLNormalizationTest(PythonicTestCase):
 
    def test_can_replace_linebreaks_with_p_tags(self):
        htmlified_text = clean_xhtml('first\nline\n\nsecond line')
    def test_can_replace_linebreaks_with_p_tags(self):
        htmlified_text = clean_xhtml('first\nline\n\nsecond line')
        assert_equals('<p>first line</p><p>second line</p>', htmlified_text)
        assert_equals(htmlified_text, clean_xhtml(htmlified_text))
 
    def test_trailing_newlines_are_removed_in_output(self):
        assert_equals(clean_xhtml('first\n'), clean_xhtml('first\n\n'))