Created
September 8, 2011 17:16
-
-
Save readevalprint/1203968 to your computer and use it in GitHub Desktop.
html comments to stop links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ArticlePreviewTests(TestCaseBase): | |
#..... | |
def test_comments_no_linkify(self): | |
d = _create_document(title='Template:Foo') | |
revision(document=d, | |
is_approved=True, | |
is_ready_for_localization=True, | |
save=True, | |
content='iamalink.com imnotalink.<!-- -->com') | |
# preview wiki to assert the link is a link | |
url = reverse('wiki.preview') | |
response = self.client.post(url, {'content': '[[Template:Foo]]'}) | |
eq_(200, response.status_code) | |
doc = pq(response.content) | |
eq_(u'<a href="http://iamalink.com">iamalink.com</a>' | |
u' imnotalink.com\n\n', | |
doc('p').html()) | |
# output: u'<a href="http://iamalink.com">iamalink.com</a> <a href="http://imnotalink.com">imnotalink.com</a>\n\n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment