<commit_before>import os

from django.conf import settings

from django.core.urlresolvers import reverse
from rest_framework.test import APITestCase
from .test_views import LoginMixin

from rest_framework.exceptions import ValidationError
from common.models import County
from facilities.models import Facility, FacilityContact
from model_mommy import mommy
from common.renderers import _write_excel_file


class TestExcelRenderer(LoginMixin, APITestCase):
    def test_get_excel_from_end_point(self):
        url = reverse('api:common:counties_list')
        excel_url = url + "?format=excel"
        mommy.make(County)
        mommy.make(County)
        response = self.client.get(excel_url)
        self.assertEquals(200, response.status_code)<commit_msg>Clean up<commit_after>import os

from django.conf import settings

from django.core.urlresolvers import reverse
from rest_framework.test import APITestCase
from .test_views import LoginMixin

from rest_framework.exceptions import ValidationError
from common.models import County
from model_mommy import mommy
from common.renderers import _write_excel_file


class TestExcelRenderer(LoginMixin, APITestCase):
    def test_get_excel_from_end_point(self):
        url = reverse('api:common:counties_list')
        excel_url = url + "?format=excel"
        mommy.make(County)
        mommy.make(County)
        response = self.client.get(excel_url)
        self.assertEquals(200, response.status_code)
{'fraction_non_alphanumeric': 0.06597938144329897, 'fraction_numerical': 0.004123711340206186, 'mean_word_length': 4.6875, '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': '651855', 'n_tokens_mistral': 444, 'n_tokens_neox': 424, 'n_words': 105}