<commit_before>import sys
from StringIO import StringIO
from django.test import TestCase
from django.core.management import call_command
from xmodule.modulestore.tests.factories import CourseFactory

class ClashIdTestCase(TestCase):
    """
    Test for course_id_clash.
    """
    def test_course_clash(self):
        """
        Test for course_id_clash.
        """
        expected = []
        # clashing courses
        course = CourseFactory.create(org="test", course="courseid", display_name="run1")
        expected.append(course.location.course_id)
        course = CourseFactory.create(org="TEST", course="courseid", display_name="RUN12")
        expected.append(course.location.course_id)
        course = CourseFactory.create(org="test", course="CourseId", display_name="aRUN123")
        expected.append(course.location.course_id)
        # not clashing courses
        not_expected = []
        course = CourseFactory.create(org="test", course="course2", display_name="run1")
        not_expected.append(course.location.course_id)
        course = CourseFactory.create(org="test1", course="courseid", display_name="run1")
        not_expected.append(course.location.course_id)
        course = CourseFactory.create(org="test", course="courseid0", display_name="run1")
        not_expected.append(course.location.course_id)

        old_stdout = sys.stdout
        sys.stdout = mystdout = StringIO()
        call_command('course_id_clash', stdout=mystdout)
        sys.stdout = old_stdout<commit_msg>Skipping new test until Jenkins mongo updated to >= 2.2<commit_after>import sys
from StringIO import StringIO
from django.test import TestCase
from django.core.management import call_command
from xmodule.modulestore.tests.factories import CourseFactory
from nose.plugins.skip import SkipTest

@SkipTest
class ClashIdTestCase(TestCase):
    """
    Test for course_id_clash.
    """
    def test_course_clash(self):
        """
        Test for course_id_clash.
        """
        expected = []
        # clashing courses
        course = CourseFactory.create(org="test", course="courseid", display_name="run1")
        expected.append(course.location.course_id)
        course = CourseFactory.create(org="TEST", course="courseid", display_name="RUN12")
        expected.append(course.location.course_id)
        course = CourseFactory.create(org="test", course="CourseId", display_name="aRUN123")
        expected.append(course.location.course_id)
        # not clashing courses
        not_expected = []
        course = CourseFactory.create(org="test", course="course2", display_name="run1")
        not_expected.append(course.location.course_id)
        course = CourseFactory.create(org="test1", course="courseid", display_name="run1")
        not_expected.append(course.location.course_id)
        course = CourseFactory.create(org="test", course="courseid0", display_name="run1")
        not_expected.append(course.location.course_id)

        old_stdout = sys.stdout
        sys.stdout = mystdout = StringIO()
        call_command('course_id_clash', stdout=mystdout)
        sys.stdout = old_stdout
{'fraction_non_alphanumeric': 0.11214354373598205, 'fraction_numerical': 0.008330663248958666, 'mean_word_length': 3.6047197640117994, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '7153341', 'n_tokens_mistral': 896, 'n_tokens_neox': 880, 'n_words': 160}