<commit_before>import unittest
from django.conf import settings
from celery.discovery import autodiscover
from celery.task import tasks


class TestDiscovery(unittest.TestCase):

    def assertDiscovery(self):
        apps = autodiscover()
        self.assertTrue(apps)
        tasks.autodiscover()
        self.assertTrue("c.unittest.SomeAppTask" in tasks)
        self.assertEquals(tasks["c.unittest.SomeAppTask"].run(), 42)

    def test_discovery(self):
        if "someapp" in settings.INSTALLED_APPS:
            self.assertDiscovery()

    def test_discovery_with_broken(self):
        settings.INSTALLED_APPS = settings.INSTALLED_APPS + ["xxxnot.aexist"]
        self.assertDiscovery()
<commit_msg>Fixed discovery to make sure app is in INSTALLED_APPS<commit_after>import unittest
from django.conf import settings
from celery.discovery import autodiscover
from celery.task import tasks


class TestDiscovery(unittest.TestCase):

    def assertDiscovery(self):
        apps = autodiscover()
        self.assertTrue(apps)
        tasks.autodiscover()
        self.assertTrue("c.unittest.SomeAppTask" in tasks)
        self.assertEquals(tasks["c.unittest.SomeAppTask"].run(), 42)

    def test_discovery(self):
        if "someapp" in settings.INSTALLED_APPS:
            self.assertDiscovery()

    def test_discovery_with_broken(self):
        if "someapp" in settings.INSTALLED_APPS:
            settings.INSTALLED_APPS = settings.INSTALLED_APPS + ["xxxnot.aexist"]
            self.assertDiscovery()

{'fraction_non_alphanumeric': 0.09145129224652088, 'fraction_numerical': 0.0026507620941020544, 'mean_word_length': 3.4411764705882355, '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': '4867185', 'n_tokens_mistral': 464, 'n_tokens_neox': 436, 'n_words': 92}