<commit_before>from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from unittest2 import skipIf
import json
from myuw_mobile.test.api import missing_url, get_user, get_user_pass

@override_settings(RESTCLIENTS_HFS_DAO_CLASS='myuw_mobile.restclients.dao_implementation.hfs.File',
                   AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',)
                   )
class TestHFS(TestCase):
    def setUp(self):
        self.client = Client()

    @skipIf(missing_url("myuw_home"), "myuw urls not configured")
    def test_javerage(self):
        url = reverse("myuw_hfs_api")
        get_user('javerage')
        self.client.login(username='javerage', password=get_user_pass('<PASSWORD>'))

        response = self.client.get(url)
        self.assertEquals(response.status_code, 200)
<commit_msg>Adding the middleware definition for the hfs tests<commit_after>from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from unittest2 import skipIf
import json
from myuw_mobile.test.api import missing_url, get_user, get_user_pass

@override_settings(RESTCLIENTS_HFS_DAO_CLASS='myuw_mobile.restclients.dao_implementation.hfs.File',
                   MIDDLEWARE_CLASSES = (
                                'django.contrib.sessions.middleware.SessionMiddleware',
                                'django.middleware.common.CommonMiddleware',
                                'django.middleware.csrf.CsrfViewMiddleware',
                                'django.contrib.auth.middleware.AuthenticationMiddleware',
                                'django.contrib.auth.middleware.RemoteUserMiddleware',
                                'django.contrib.messages.middleware.MessageMiddleware',
                                'django.middleware.clickjacking.XFrameOptionsMiddleware',
                                'userservice.user.UserServiceMiddleware',
                                ),
                   AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',)
                   )
class TestHFS(TestCase):
    def setUp(self):
        self.client = Client()

    @skipIf(missing_url("myuw_home"), "myuw urls not configured")
    def test_javerage(self):
        url = reverse("myuw_hfs_api")
        get_user('javerage')
        self.client.login(username='javerage', password=get_user_pass('<PASSWORD>'))

        response = self.client.get(url)
        self.assertEquals(response.status_code, 200)

{'fraction_non_alphanumeric': 0.08998493975903614, 'fraction_numerical': 0.0030120481927710845, 'mean_word_length': 2.6902777777777778, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6245565', 'n_tokens_mistral': 742, 'n_tokens_neox': 723, 'n_words': 122}