aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/resources/tests/test_to_kebabcase.py
blob: a141143d1da0d0b1416dfbd621b877aa49292eed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from django.test import TestCase

from pydis_site.apps.resources.templatetags.to_kebabcase import _to_kebabcase


class TestToKebabcase(TestCase):
    """Tests for the `as_css_class` template tag."""

    def test_to_kebabcase(self):
        """Test the to_kebabcase utility and template tag."""
        weird_input = (
            "_-_--_A_LEm0n?in&¤'the##trEE£$@€@€@@£is-NOT----QUITE//"
            "as#good!  as one   __IN-YOUR|||HaND"
        )

        self.assertEqual(
            _to_kebabcase(weird_input),
            "a-lem0n-in-the-tree-is-not-quite-as-good-as-one-in-your-hand",
        )