<commit_before>from django.test import TestCase
from phonenumber_field.phonenumber import PhoneNumber

from agir.lib.phone_numbers import (
    is_mobile_number,
    is_french_number,
    is_hexagonal_number,
    normalize_overseas_numbers,
)


def p(phone_number):
    return PhoneNumber.from_string(phone_number, "FR")


class PhoneNumbersTestCase(TestCase):
    def test_is_mobile(self):
        self.assertTrue(is_mobile_number(p("06 38 68 98 45")))

        self.assertTrue(is_mobile_number(p("07 34 98 56 78")))

        self.assertTrue(is_mobile_number(p("06 90 48 25 64")))  # Guadeloupe, en +33

        self.assertTrue(
            is_mobile_number(p("+590 6 90 48 25 64"))  # Guadeloupe, en +590
        )

        self.assertFalse(is_mobile_number(p("01 42 87 65 89")))

        self.assertFalse(is_mobile_number(p("09 45 87 65 23")))

        self.assertFalse(is_mobile_number(p("05 90 45 78 56")))  # Guadeloupe, en +33

        self.assertFalse(
            is_mobile_number(p("+590 5 90 45 78 56"))  # Guadeloupe, en +590
        )

    def test_is_french(self):
        self.assertTrue(is_french_number(p("06 38 68 98 45")))

        self.assertTrue(is_french_number(p("01 48 68 98 45")))

        self.assertTrue(is_french_number(p("04 84 65 98 78")))
<commit_msg>fix: tests on phone numbers<commit_after>from django.test import TestCase
from phonenumber_field.phonenumber import PhoneNumber

from agir.lib.phone_numbers import (
    is_mobile_number,
    is_french_number,
    is_hexagonal_number,
    normalize_overseas_numbers,
)


def p(phone_number):
    return PhoneNumber.from_string(phone_number, "FR")


class PhoneNumbersTestCase(TestCase):
    def test_is_mobile(self):
        self.assertTrue(is_mobile_number(p("06 38 68 98 45")))

        self.assertTrue(is_mobile_number(p("07 34 98 56 78")))

        self.assertFalse(is_mobile_number(p("06 90 48 25 64")))  # Guadeloupe, en +33

        self.assertTrue(
            is_mobile_number(p("+590 6 90 48 25 64"))  # Guadeloupe, en +590
        )

        self.assertFalse(is_mobile_number(p("01 42 87 65 89")))

        self.assertFalse(is_mobile_number(p("09 45 87 65 23")))

        self.assertFalse(is_mobile_number(p("05 90 45 78 56")))  # Guadeloupe, en +33

        self.assertFalse(
            is_mobile_number(p("+590 5 90 45 78 56"))  # Guadeloupe, en +590
        )

    def test_is_french(self):
        self.assertTrue(is_french_number(p("06 38 68 98 45")))

        self.assertTrue(is_french_number(p("01 48 68 98 45")))

        self.assertTrue(is_french_number(p("04 84 65 98 78")))

{'fraction_non_alphanumeric': 0.11205893757270259, 'fraction_numerical': 0.09616130283055448, 'mean_word_length': 3.321608040201005, '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': '1195132', 'n_tokens_mistral': 1115, 'n_tokens_neox': 871, 'n_words': 198}