<commit_before>import os

from django.conf import settings
from django.test import TestCase
from django.test.client import Client

from articles.models import Article
from osl_comments.models import CommentsBannedFromIpAddress, OslComment

class CommentsTestCase(TestCase):
    fixtures = ['comments_test_data.json']
    urls = 'osl_comments.tests.urls'
    
    def setUp(self):
        self.old_LANGUAGES = settings.LANGUAGES
        self.old_LANGUAGE_CODE = settings.LANGUAGE_CODE
        settings.LANGUAGES = (('en', 'English'),)
        settings.LANGUAGE_CODE = 'en'
        self.old_TEMPLATE_DIRS = settings.TEMPLATE_DIRS
        settings.TEMPLATE_DIRS = (
            os.path.join(
                os.path.dirname(__file__),
                'templates'
            )
        ,)
    
    def tearDown(self):
        settings.LANGUAGES = self.old_LANGUAGES
        settings.LANGUAGE_CODE = self.old_LANGUAGE_CODE
        settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
        
    ## Article access tests ##<commit_msg>Remove unnecessary import<commit_after>import os

from django.conf import settings
from django.test import TestCase
from django.test.client import Client

from osl_comments.models import CommentsBannedFromIpAddress, OslComment

class CommentsTestCase(TestCase):
    fixtures = ['comments_test_data.json']
    urls = 'osl_comments.tests.urls'
    
    def setUp(self):
        self.old_LANGUAGES = settings.LANGUAGES
        self.old_LANGUAGE_CODE = settings.LANGUAGE_CODE
        settings.LANGUAGES = (('en', 'English'),)
        settings.LANGUAGE_CODE = 'en'
        self.old_TEMPLATE_DIRS = settings.TEMPLATE_DIRS
        settings.TEMPLATE_DIRS = (
            os.path.join(
                os.path.dirname(__file__),
                'templates'
            )
        ,)
    
    def tearDown(self):
        settings.LANGUAGES = self.old_LANGUAGES
        settings.LANGUAGE_CODE = self.old_LANGUAGE_CODE
        settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
        
    ## Article access tests ##
{'fraction_non_alphanumeric': 0.0824284304047384, 'fraction_numerical': 0.0, 'mean_word_length': 2.6588447653429603, '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': '1874853', 'n_tokens_mistral': 630, 'n_tokens_neox': 617, 'n_words': 112}