<commit_before># pylint: disable=missing-docstring
from django.test import TestCase
from common.util import slugify


class PagesTest(TestCase):

    def test_get_homepage(self):
        response = self.client.get("/")
        self.assertEqual(response.status_code, 200)

    def test_non_existent(self):
        response = self.client.get("/foobar/baz")
        self.assertEqual(response.status_code, 404)


class TestNewsFeed(TestCase):
    def test_feed_availability(self):
        response = self.client.get("/news/feed/")
        self.assertEqual(response.status_code, 200)


class TestUtils(TestCase):
    def test_slugify(self):
        self.assertEqual(slugify(None), "")
        self.assertEqual(slugify("Foo bar"), "foo-bar")
        self.assertEqual(slugify("わがままアリスと百日戦争"), "wagamamaarisuto")
        self.assertEqual(
            slugify("关于我被小学女生绑架这件事"),
            "guan-yu-wo-bei-xiao-xue-nv-sheng-bang-jia-zhe-jian-shi"
        )
<commit_msg>Update slug test<commit_after># pylint: disable=missing-docstring
from django.test import TestCase
from common.util import slugify


class PagesTest(TestCase):

    def test_get_homepage(self):
        response = self.client.get("/")
        self.assertEqual(response.status_code, 200)

    def test_non_existent(self):
        response = self.client.get("/foobar/baz")
        self.assertEqual(response.status_code, 404)


class TestNewsFeed(TestCase):
    def test_feed_availability(self):
        response = self.client.get("/news/feed/")
        self.assertEqual(response.status_code, 200)


class TestUtils(TestCase):
    def test_slugify(self):
        self.assertEqual(slugify(None), "")
        self.assertEqual(slugify("Foo bar"), "foo-bar")
        self.assertEqual(slugify("わがままアリスと百日戦争"), "wagamamaarisuto")
        self.assertEqual(
            slugify("关于我被小学女生绑架这件事"),
            "guan-yu-wo-bei-xiao-xue-nv-sheng-bang-jia-zhe-jian"
        )

{'fraction_non_alphanumeric': 0.12767066180302242, 'fraction_numerical': 0.009379885356956748, 'mean_word_length': 3.247787610619469, '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': '1948132', 'n_tokens_mistral': 675, 'n_tokens_neox': 644, 'n_words': 94}