<commit_before>"""
Test scenarios for the crowdsource hinter xblock.
"""
from __future__ import absolute_import

import json
import unittest

from django.conf import settings
from django.urls import reverse
from six import text_type
from six.moves import range

from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory
from lms.djangoapps.courseware.tests.helpers import LoginEnrollmentTestCase
from openedx.core.lib.url_utils import quote_slashes
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory


class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
    """
    Create the test environment with the crowdsourcehinter xblock.
    """
    STUDENTS = [
        {'email': '<EMAIL>', 'password': '<PASSWORD>'},
        {'email': '<EMAIL>', 'password': '<PASSWORD>'}
    ]
    XBLOCK_NAMES = ['crowdsourcehinter']

    @classmethod
    def setUpClass(cls):
        # Nose runs setUpClass methods even if a class decorator says to skip
        # the class: https://github.com/nose-devs/nose/issues/946<commit_msg>BOM-924 Fixing TypeError, the JSON object must be str, not 'bytes'.<commit_after>"""
Test scenarios for the crowdsource hinter xblock.
"""
from __future__ import absolute_import

import unittest

import simplejson as json
from django.conf import settings
from django.urls import reverse
from six import text_type
from six.moves import range

from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory
from lms.djangoapps.courseware.tests.helpers import LoginEnrollmentTestCase
from openedx.core.lib.url_utils import quote_slashes
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory


class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
    """
    Create the test environment with the crowdsourcehinter xblock.
    """
    STUDENTS = [
        {'email': '<EMAIL>', 'password': '<PASSWORD>'},
        {'email': '<EMAIL>', 'password': '<PASSWORD>'}
    ]
    XBLOCK_NAMES = ['crowdsourcehinter']

    @classmethod
    def setUpClass(cls):
        # Nose runs setUpClass methods even if a class decorator says to skip
        # the class: https://github.com/nose-devs/nose/issues/946
{'fraction_non_alphanumeric': 0.08746846089150546, 'fraction_numerical': 0.0037846930193439865, 'mean_word_length': 4.705035971223022, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '5393828', 'n_tokens_mistral': 689, 'n_tokens_neox': 680, 'n_words': 197}