<commit_before>from django.test import TestCase

from nose.tools import ok_

from mrburns.main import views


class TestViewHelpers(TestCase):
    def test_twitter_share_url_fn(self):
        """Should return a proper and endoded twitter share url."""
        url = views.get_tw_share_url(url='http://example.com', text='The Dude abides.')
        ok_(url.startswith(views.TWITTER_URL + '?'))
        ok_('dnt=true' in url)
        ok_('hashtags=firefox' in url)
        ok_('url=http%3A%2F%2Fexample.com' in url)
        ok_('text=The+Dude+abides.' in url)

    def test_facebook_share_url_fn(self):
        """Should return a proper and encoded facebook share url."""
        url = views.get_fb_share_url('http://example.com')
        ok_(url.startswith(views.FB_URL + '?'))
        ok_('u=http%3A%2F%2Fexample.com' in url)<commit_msg>Fix twitter url helper test.<commit_after>from django.test import TestCase

from nose.tools import ok_

from mrburns.main import views


class TestViewHelpers(TestCase):
    def test_twitter_share_url_fn(self):
        """Should return a proper and endoded twitter share url."""
        url = views.get_tw_share_url(url='http://example.com', text='The Dude abides.',
                                     hashtags='firefox')
        ok_(url.startswith(views.TWITTER_URL + '?'))
        ok_('dnt=true' in url)
        ok_('hashtags=firefox' in url)
        ok_('url=http%3A%2F%2Fexample.com' in url)
        ok_('text=The+Dude+abides.' in url)

    def test_facebook_share_url_fn(self):
        """Should return a proper and encoded facebook share url."""
        url = views.get_fb_share_url('http://example.com')
        ok_(url.startswith(views.FB_URL + '?'))
        ok_('u=http%3A%2F%2Fexample.com' in url)
{'fraction_non_alphanumeric': 0.1300114547537228, 'fraction_numerical': 0.006872852233676976, 'mean_word_length': 3.1794258373205744, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6848405', 'n_tokens_mistral': 598, 'n_tokens_neox': 584, 'n_words': 124}