from unittest import skip

from django.test import TestCase

from .. import forms, managers, view_helpers


class DataHelperTest(TestCase):
    data_manager = view_helpers.SerializedDataHelper
    manager = managers.FormManager
    fixtures = [
        'wizard_builder_data',
    ]

    def test_data_generates(self):
        form = self.manager.get_forms()[1]
        zipped_data = self.data_manager.get_zipped_data(
            data={'question_2': 'owlette ipsum cattree'},
            forms=[form.serialized],
        )
        self.assertIsInstance(zipped_data, list)

    def test_data_textbox(self):
        form = self.manager.get_forms()[1]
        zipped_data = self.data_manager.get_zipped_data(
            data={'question_2': 'owlette ipsum cattree'},
            forms=[form.serialized],
        )
        self.assertIn(
            {'do androids dream of electric sheep?':
                ['owlette ipsum cattree'],
             },
            zipped_data,
        )

    def test_data_multiple_choice(self):
        form = self.manager.get_forms()[0]
        zipped_data = self.data_manager.get_zipped_data(
            data={'question_1': ['3']},
            forms=[form.serialized],
        )
        self.assertIn(
            {'food options': ['sugar']},
            zipped_data,
        )

    def test_data_multiple_choice_string(self):
        form = self.manager.get_forms()[0]
        zipped_data = self.data_manager.get_zipped_data(
            data={'question_1': '3'},
            forms=[form.serialized],
        )
        self.assertIn(
            {'food options': ['sugar']},
            zipped_data,
        )

    @skip('WIP')
    def test_data_multiple_choice_extra_info_empty(self):
        form = self.manager.get_forms()[0]
        zipped_data = self.data_manager.get_zipped_data(
            data={
                'question_1': ['1'],
            },
            forms=[form.serialized],
        )
        self.assertIn(
            {'food options': ['sugar']},
            zipped_data,
        )

    @skip('WIP')
    def test_data_multiple_choice_extra_info_filled(self):
        form = self.manager.get_forms()[0]
        zipped_data = self.data_manager.get_zipped_data(
            data={
                'question_1': ['1'],
                'extra_info': 'beets'
            },
            forms=[form.serialized],
        )
        self.assertIn(
            {'food options': ['sugar: beets']},
            zipped_data,
        )

@@ -1295,32 +1295,397 @@
 ata,%0A        )%0A%0A
+    def test_data_multiple_choice_multiple_options(self):%0A        form = self.manager.get_forms()%5B0%5D%0A        zipped_data = self.data_manager.get_zipped_data(%0A            data=%7B'question_1': %5B'1', '2'%5D%7D,%0A            forms=%5Bform.serialized%5D,%0A        )%0A        self.assertIn(%0A            %7B'food options': %5B'vegetables', 'apples'%5D%7D,%0A            zipped_data,%0A        )%0A%0A
     def test_dat

add data helper test