<commit_before># -*- coding: utf-8 -*-
"""
End-to-end tests for survey of biz feature
"""
import csv
import os
import shutil
from unittest import skip

import bok_choy
from bok_choy.web_app_test import WebAppTest
from nose.plugins.attrib import attr

from common.test.acceptance.pages.biz.ga_contract import BizContractPage
from common.test.acceptance.pages.biz.ga_navigation import BizNavPage
from common.test.acceptance.pages.lms.courseware import CoursewarePage
from common.test.acceptance.pages.lms.course_nav import CourseNavPage
from common.test.acceptance.pages.lms.ga_instructor_dashboard import InstructorDashboardPage
from common.test.acceptance.pages.lms.ga_survey import SurveyPage
from common.test.acceptance.tests.biz import PLATFORMER_USER_INFO, \
    GaccoBizTestMixin, A_DIRECTOR_USER_INFO, A_COMPANY, SUPER_USER_INFO
from ..helpers import load_data_str
from ...fixtures.course import CourseFixture, XBlockFixtureDesc

DOWNLOAD_DIR = '/tmp'


@skip("Until apply security patch")
@attr('shard_ga_biz_1')
class BizSurveyTest(WebAppTest, GaccoBizTestMixin):
    """
    Tests that the survey functionality of biz works
    """

    def setUp(self):
        super(BizSurveyTest, self).setUp()
        # Install course
        self.course = CourseFixture('plat', self._testMethodName, 'biz_test_run', 'Biz Course ' + self._testMethodName)
        self.course.add_children(
                XBlockFixtureDesc('chapter', 'Test Section').add_children(
                        XBlockFixtureDesc('sequential', 'Test Subsection').add_children(
                                XBlockFixtureDesc('vertical', 'Test Unit').add_children(
                                        XBlockFixtureDesc('html', 'Test HTML', data=load_data_str('ga_survey.html'))
                                )
                        )
                )
        ).install()

        # Register a contract for A company
        self.switch_to_user(PLATFORMER_USER_INFO)
        self.contract = self.create_contract(BizContractPage(self.browser).visit(), 'PF', '2016/01/01',
                                             '2100/01/01', contractor_organization=A_COMPANY,
                                             detail_info=[self.course._course_key], additional_info=[u'部署'])<commit_msg>Restore bokchoy of biz survey #939<commit_after># -*- coding: utf-8 -*-
"""
End-to-end tests for survey of biz feature
"""
import csv
import os
import shutil

import bok_choy
from bok_choy.web_app_test import WebAppTest
from nose.plugins.attrib import attr

from common.test.acceptance.pages.biz.ga_contract import BizContractPage
from common.test.acceptance.pages.biz.ga_navigation import BizNavPage
from common.test.acceptance.pages.lms.courseware import CoursewarePage
from common.test.acceptance.pages.lms.course_nav import CourseNavPage
from common.test.acceptance.pages.lms.ga_instructor_dashboard import InstructorDashboardPage
from common.test.acceptance.pages.lms.ga_survey import SurveyPage
from common.test.acceptance.tests.biz import PLATFORMER_USER_INFO, \
    GaccoBizTestMixin, A_DIRECTOR_USER_INFO, A_COMPANY, SUPER_USER_INFO
from ..helpers import load_data_str
from ...fixtures.course import CourseFixture, XBlockFixtureDesc

DOWNLOAD_DIR = '/tmp'


@attr('shard_ga_biz_1')
class BizSurveyTest(WebAppTest, GaccoBizTestMixin):
    """
    Tests that the survey functionality of biz works
    """

    def setUp(self):
        super(BizSurveyTest, self).setUp()
        # Install course
        self.course = CourseFixture('plat', self._testMethodName, 'biz_test_run', 'Biz Course ' + self._testMethodName)
        self.course.add_children(
                XBlockFixtureDesc('chapter', 'Test Section').add_children(
                        XBlockFixtureDesc('sequential', 'Test Subsection').add_children(
                                XBlockFixtureDesc('vertical', 'Test Unit').add_children(
                                        XBlockFixtureDesc('html', 'Test HTML', data=load_data_str('ga_survey.html'))
                                )
                        )
                )
        ).install()

        # Register a contract for A company
        self.switch_to_user(PLATFORMER_USER_INFO)
        self.contract = self.create_contract(BizContractPage(self.browser).visit(), 'PF', '2016/01/01',
                                             '2100/01/01', contractor_organization=A_COMPANY,
                                             detail_info=[self.course._course_key], additional_info=[u'部署'])
{'fraction_non_alphanumeric': 0.09352037408149633, 'fraction_numerical': 0.008684034736138945, 'mean_word_length': 2.832764505119454, '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': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5904304', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1287, 'n_words': 260}