Ticket #3963: truncate_optional_replacement_v2_tests.patch

File truncate_optional_replacement_v2_tests.patch, 913 bytes (added by Johan Bergström <bugs@…>, 17 years ago)

test cases for latest patch (v2)

  • tests/regressiontests/defaultfilters/tests.py

     
    8080>>> truncatewords('A sentence with a few words in it', 1)
    8181'A ...'
    8282
     83>>> truncatewords('A sentence with a few words in it', '1,..')
     84'A ..'
     85
    8386>>> truncatewords('A sentence with a few words in it', 5)
    8487'A sentence with a few ...'
    8588
     
    9598>>> truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 2)
    9699'<p>one <a href="#">two ...</a></p>'
    97100
     101>>> truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', '2, ..')
     102'<p>one <a href="#">two ..</a></p>'
     103
    98104>>> truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 4)
    99105'<p>one <a href="#">two - three <br>four ...</a></p>'
    100106
Back to Top