# Path: test_projects/django18/likert_test_app/models.py
# class ParametersModel(models.Model):
#     ice_cream_is_yummy = LikertField()
#     # cabbage_is_yummy = LikertField(max_value=4)
#     item = LikertField('ice cream beats cabbage')
#     # seven = LikertField('seven is my lucky number', max_value=7)
#     # ten = LikertField('ten is the best', max_value=10)
# 
#     questions_should_not_be_optional = LikertField(blank=False)


from django.test import TestCase
from django.core.urlresolvers import reverse
from .models import ParametersModel
            'questions_should_not_be_optional': '5'
        }
        response = self.client.post(reverse('likert_add'), post_data)
        self.assertEqual(response.status_code, 302)
        surveys = ParametersModel.objects.all()
        self.assertEqual(len(surveys), 1)
        survey = surveys[0]
        self.assertTrue(survey.item is None)

    def test_creation_noanswer(self):
        post_data = {
            'ice_cream_is_yummy': '',
            'item': '',
            'questions_should_not_be_optional': ''
        }
        response = self.client.post(reverse('likert_add'), post_data)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(
            response.context['form'].errors[
                'questions_should_not_be_optional'],
            ['This field is required.'])

    def test_added_view(self):
        response = self.client.get(reverse('likert_added'))
        self.assertEqual(response.status_code, 200)


class SurveyDetailViewTestCase(TestCase):

    def setUp(self):

# Path: test_projects/django18/likert_test_app/models.py
# class ParametersModel(models.Model):
#     ice_cream_is_yummy = LikertField()
#     # cabbage_is_yummy = LikertField(max_value=4)
#     item = LikertField('ice cream beats cabbage')
#     # seven = LikertField('seven is my lucky number', max_value=7)
#     # ten = LikertField('ten is the best', max_value=10)
# 
#     questions_should_not_be_optional = LikertField(blank=False)


# Path: test_projects/django18/likert_test_app/tests.py
from django.test import TestCase
from django.core.urlresolvers import reverse
from .models import ParametersModel

            'questions_should_not_be_optional': '5'
        }
        response = self.client.post(reverse('likert_add'), post_data)
        self.assertEqual(response.status_code, 302)
        surveys = ParametersModel.objects.all()
        self.assertEqual(len(surveys), 1)
        survey = surveys[0]
        self.assertTrue(survey.item is None)

    def test_creation_noanswer(self):
        post_data = {
            'ice_cream_is_yummy': '',
            'item': '',
            'questions_should_not_be_optional': ''
        }
        response = self.client.post(reverse('likert_add'), post_data)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(
            response.context['form'].errors[
                'questions_should_not_be_optional'],
            ['This field is required.'])

    def test_added_view(self):
        response = self.client.get(reverse('likert_added'))
        self.assertEqual(response.status_code, 200)


class SurveyDetailViewTestCase(TestCase):

    def setUp(self):

        survey = ParametersModel.objects.create(