<commit_before>from datetime import date, timedelta

from django.core.urlresolvers import resolve, reverse
from django.http import Http404
from django.test import RequestFactory, TestCase
from model_mommy import mommy

from .models import Iteration
from .views import DayEditionView, TodayEditionView


class EditionURLTests(TestCase):
    """
    Are the URLs calling the correct views?
    """

    def test_implicit_today_url(self):
        response = self.client.get('/edition/matt/')
        view = resolve(response.request['PATH_INFO'])[0]
        self.assertEqual(view.__name__, 'TodayEditionView')

    def test_today_url(self):
        response = self.client.get('/edition/matt/today/')
        view = resolve(response.request['PATH_INFO'])[0]
        self.assertEqual(view.__name__, 'TodayEditionView')

    def test_day_url(self):
        response = self.client.get('/edition/matt/2014/12/25/')
        view = resolve(response.request['PATH_INFO'])[0]
        self.assertEqual(view.__name__, 'DayEditionView')

    def test_day_month_name_url(self):
        response = self.client.get('/edition/matt/2014/dec/25/')
        view = resolve(response.request['PATH_INFO'])[0]
        self.assertEqual(view.__name__, 'DayEditionView')

<commit_msg>Remove unnecessary client requests in unit tests<commit_after>from datetime import date, timedelta

from django.core.urlresolvers import resolve, reverse
from django.http import Http404
from django.test import RequestFactory, TestCase
from model_mommy import mommy

from .models import Iteration
from .views import DayEditionView, TodayEditionView


class EditionURLTests(TestCase):
    """
    Are the URLs calling the correct views?
    """

    def test_implicit_today_url(self):
        view = resolve('/edition/matt/')[0]
        self.assertEqual(view.__name__, 'TodayEditionView')

    def test_today_url(self):
        view = resolve('/edition/matt/today/')[0]
        self.assertEqual(view.__name__, 'TodayEditionView')

    def test_day_url(self):
        view = resolve('/edition/matt/2014/12/25/')[0]
        self.assertEqual(view.__name__, 'DayEditionView')

    def test_day_month_name_url(self):
        view = resolve('/edition/matt/2014/dec/25/')[0]
        self.assertEqual(view.__name__, 'DayEditionView')


{'fraction_non_alphanumeric': 0.11408512505484862, 'fraction_numerical': 0.018429135585783237, 'mean_word_length': 3.8202959830866807, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2334117', 'n_tokens_mistral': 727, 'n_tokens_neox': 677, 'n_words': 144}