from django.test import TestCase
from myideas.core.forms import IdeasForm


class IdeasFormTest(TestCase):

    def test_form_has_fields(self):
        """Form must have 3 fields"""
        form = IdeasForm()
        expected = ('title', 'description', 'tags')
        self.assertSequenceEqual(expected, list(form.fields))

    def assertFormErrorCode(self, form, field, code):
        errors = form.errors.as_data()
        errors_list = errors[field]
        exception = errors_list[0]
        self.assertEqual(code, exception.code)

@@ -66,17 +66,34 @@
 deasForm
+, IdeasFormUpdate
 %0A
-
 %0A%0Aclass 
@@ -117,17 +117,16 @@
 tCase):%0A
-%0A
     def 
@@ -218,16 +218,16 @@
 sForm()%0A
-
         
@@ -544,8 +544,473 @@
 n.code)%0A
+%0A%0Aclass IdeasFormUpdateTest(TestCase):%0A%0A    def test_form_has_fields(self):%0A        %22%22%22Form must have 2 fields%22%22%22%0A        form = IdeasFormUpdate()%0A        expected = ('title', 'description')%0A        self.assertSequenceEqual(expected, list(form.fields))%0A%0A    def assertFormErrorCode(self, form, field, code):%0A        errors = form.errors.as_data()%0A        errors_list = errors%5Bfield%5D%0A        exception = errors_list%5B0%5D%0A        self.assertEqual(code, exception.code)%0A

update tests