<commit_before>from datetime import datetime

from corehq.apps.commtrack.models import CommtrackConfig, ConsumptionConfig
from corehq.apps.consumption.shortcuts import set_default_consumption_for_supply_point
from corehq.apps.sms.tests import setup_default_sms_test_backend, delete_domain_phone_numbers
from corehq.util.translation import localize
from custom.ilsgateway.models import SupplyPointStatus, DeliveryGroups, SupplyPointStatusTypes, \
    SupplyPointStatusValues, SLABConfig
from custom.ilsgateway.slab.messages import REMINDER_STOCKOUT
from custom.ilsgateway.slab.reminders.stockout import StockoutReminder
from custom.ilsgateway.tanzania.reminders import update_statuses
from custom.ilsgateway.tanzania.reminders.delivery import DeliveryReminder
from custom.ilsgateway.tanzania.reminders.randr import RandrReminder
from custom.ilsgateway.tanzania.reminders.soh_thank_you import SOHThankYouReminder
from custom.ilsgateway.tanzania.reminders.stockonhand import SOHReminder
from custom.ilsgateway.tanzania.reminders.supervision import SupervisionReminder
from custom.ilsgateway.tests.handlers.utils import ILSTestScript, TEST_DOMAIN, prepare_domain, create_products
from custom.ilsgateway.utils import make_loc
from custom.logistics.tests import TestScript
from custom.logistics.tests.utils import bootstrap_user


class RemindersTest(ILSTestScript):

    @classmethod
    def setUpClass(cls):
        super(RemindersTest, cls).bypass_setUpClass()
        cls.sms_backend, cls.sms_backend_mapping = setup_default_sms_test_backend()
        cls.domain = prepare_domain(TEST_DOMAIN)

        cls.district = make_loc(code="dis1", name="Test District 1", type="DISTRICT",
                                domain=TEST_DOMAIN)
        cls.facility = make_loc(code="loc1", name="Test Facility 1", type="FACILITY",
                                domain=TEST_DOMAIN, parent=cls.district)
        cls.facility_sp_id = cls.facility.sql_location.supply_point_id
        cls.user1 = bootstrap_user(
            cls.facility, username='test_user', domain=TEST_DOMAIN, home_loc='loc1', phone_number='5551234',
            first_name='test', last_name='Test'
        )
        create_products(cls, TEST_DOMAIN, ["id", "dp", "fs", "md", "ff", "dx", "bp", "pc", "qi", "jd", "mc", "ip"])

    def tearDown(self):<commit_msg>remove unused import<commit_after>from datetime import datetime

from corehq.apps.commtrack.models import CommtrackConfig, ConsumptionConfig
from corehq.apps.consumption.shortcuts import set_default_consumption_for_supply_point
from corehq.apps.sms.tests import setup_default_sms_test_backend, delete_domain_phone_numbers
from corehq.util.translation import localize
from custom.ilsgateway.models import SupplyPointStatus, DeliveryGroups, SupplyPointStatusTypes, \
    SupplyPointStatusValues, SLABConfig
from custom.ilsgateway.slab.messages import REMINDER_STOCKOUT
from custom.ilsgateway.slab.reminders.stockout import StockoutReminder
from custom.ilsgateway.tanzania.reminders import update_statuses
from custom.ilsgateway.tanzania.reminders.delivery import DeliveryReminder
from custom.ilsgateway.tanzania.reminders.randr import RandrReminder
from custom.ilsgateway.tanzania.reminders.soh_thank_you import SOHThankYouReminder
from custom.ilsgateway.tanzania.reminders.stockonhand import SOHReminder
from custom.ilsgateway.tanzania.reminders.supervision import SupervisionReminder
from custom.ilsgateway.tests.handlers.utils import ILSTestScript, TEST_DOMAIN, prepare_domain, create_products
from custom.ilsgateway.utils import make_loc
from custom.logistics.tests.utils import bootstrap_user


class RemindersTest(ILSTestScript):

    @classmethod
    def setUpClass(cls):
        super(RemindersTest, cls).bypass_setUpClass()
        cls.sms_backend, cls.sms_backend_mapping = setup_default_sms_test_backend()
        cls.domain = prepare_domain(TEST_DOMAIN)

        cls.district = make_loc(code="dis1", name="Test District 1", type="DISTRICT",
                                domain=TEST_DOMAIN)
        cls.facility = make_loc(code="loc1", name="Test Facility 1", type="FACILITY",
                                domain=TEST_DOMAIN, parent=cls.district)
        cls.facility_sp_id = cls.facility.sql_location.supply_point_id
        cls.user1 = bootstrap_user(
            cls.facility, username='test_user', domain=TEST_DOMAIN, home_loc='loc1', phone_number='5551234',
            first_name='test', last_name='Test'
        )
        create_products(cls, TEST_DOMAIN, ["id", "dp", "fs", "md", "ff", "dx", "bp", "pc", "qi", "jd", "mc", "ip"])

    def tearDown(self):
{'fraction_non_alphanumeric': 0.08799825746024831, 'fraction_numerical': 0.0056632541929862775, 'mean_word_length': 4.879641485275288, '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': '3094810', 'n_tokens_mistral': 1480, 'n_tokens_neox': 1407, 'n_words': 267}