<commit_before>from corehq.apps.commtrack.helpers import make_supply_point,\
    get_commtrack_user_id
from corehq.apps.commtrack import const
from corehq.apps.commtrack.tests.util import (make_loc, TEST_DOMAIN,
    CommTrackTest)
from datetime import datetime

class SupplyPointTest(CommTrackTest):

    def setUp(self):
        super(SupplyPointTest, self).setUp()
        self.loc = make_loc('loc1')

    def tearDown(self):
        self.loc.delete()
        super(CommTrackTest, self).tearDown()

    def testMakeSupplyPoint(self):
        sp = make_supply_point(TEST_DOMAIN, self.loc)
        self.assertEqual("CommCareCase", sp.doc_type)
        self.assertEqual(TEST_DOMAIN, sp.domain)
        self.assertEqual(const.SUPPLY_POINT_CASE_TYPE, sp.type)
        self.assertEqual([self.loc._id], sp.location_)
        self.assertEqual(get_commtrack_user_id(TEST_DOMAIN), sp.user_id)
        self.assertEqual(sp.user_id, sp.owner_id)
        self.assertFalse(sp.closed)
        self.assertTrue(len(sp.actions) > 0)
        for dateprop in ('opened_on', 'modified_on', 'server_modified_on'):
            self.assertTrue(getattr(sp, dateprop) is not None)
            self.assertTrue(isinstance(getattr(sp, dateprop), datetime))

    def testMakeOwnedSupplyPoint(self):
        sp = make_supply_point(TEST_DOMAIN, self.loc, 'some-other-owner')
        self.assertEqual(get_commtrack_user_id(TEST_DOMAIN), sp.user_id)
        self.assertEqual('some-other-owner', sp.owner_id)<commit_msg>change test base class back to avoid error<commit_after>from unittest import TestCase

from corehq.apps.commtrack.helpers import make_supply_point,\
    get_commtrack_user_id
from corehq.apps.commtrack import const
from corehq.apps.commtrack.tests.util import (make_loc, TEST_DOMAIN,
    CommTrackTest)
from datetime import datetime

class SupplyPointTest(TestCase):

    def setUp(self):
        self.loc = make_loc('loc1')

    def tearDown(self):
        self.loc.delete()

    def testMakeSupplyPoint(self):
        sp = make_supply_point(TEST_DOMAIN, self.loc)
        self.assertEqual("CommCareCase", sp.doc_type)
        self.assertEqual(TEST_DOMAIN, sp.domain)
        self.assertEqual(const.SUPPLY_POINT_CASE_TYPE, sp.type)
        self.assertEqual([self.loc._id], sp.location_)
        self.assertEqual(get_commtrack_user_id(TEST_DOMAIN), sp.user_id)
        self.assertEqual(sp.user_id, sp.owner_id)
        self.assertFalse(sp.closed)
        self.assertTrue(len(sp.actions) > 0)
        for dateprop in ('opened_on', 'modified_on', 'server_modified_on'):
            self.assertTrue(getattr(sp, dateprop) is not None)
            self.assertTrue(isinstance(getattr(sp, dateprop), datetime))

    def testMakeOwnedSupplyPoint(self):
        sp = make_supply_point(TEST_DOMAIN, self.loc, 'some-other-owner')
        self.assertEqual(get_commtrack_user_id(TEST_DOMAIN), sp.user_id)
        self.assertEqual('some-other-owner', sp.owner_id)
{'fraction_non_alphanumeric': 0.10702113156100886, 'fraction_numerical': 0.0013633265167007499, 'mean_word_length': 3.7262479871175525, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1454233', 'n_tokens_mistral': 950, 'n_tokens_neox': 944, 'n_words': 158}