<commit_before>from unittest import mock

from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase

from .. import view_helpers


class ViewTest(TestCase):
    fixtures = [
        'wizard_builder_data',
    ]

    @classmethod
    def setUpClass(cls):
        settings.SITE_ID = 1
        super().setUpClass()

    def test_storage_receives_post_data(self):
        step = '1'
        url = reverse('wizard_update', kwargs={'step': step})
        data = {'question_2': 'aloe ipsum speakerbox'}
        storage_data = {step: data}
        self.client.post(url, data)
        self.assertEqual(
            self.client.session['data'],
            storage_data,
        )<commit_msg>test cleanup<commit_after>from unittest import mock

from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase

from .. import view_helpers


class ViewTest(TestCase):
    fixtures = [
        'wizard_builder_data',
    ]

    @classmethod
    def setUpClass(cls):
        settings.SITE_ID = 1
        super().setUpClass()

    def setUp(self):
        super().setUp()
        self.step = '1'
        self.data = {'question_2': 'aloe ipsum speakerbox'}
        self.storage_data = {self.step: self.data}

    def test_storage_receives_post_data(self):
        url = reverse('wizard_update', kwargs={'step': self.step})
        self.client.post(url, self.data)
        self.assertEqual(
            self.client.session['data'],
            self.storage_data,
        )
{'fraction_non_alphanumeric': 0.1067524115755627, 'fraction_numerical': 0.0038585209003215433, 'mean_word_length': 2.6102088167053363, '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': '5812587', 'n_tokens_mistral': 470, 'n_tokens_neox': 465, 'n_words': 104}