Files @ 7086387253d4
Branch filter:

Location: conntrackt/conntrackt/tests/test_forms.py

branko
CONNT-4: Implemented custom ModelForm for Entity. Implemented create view for entities. Added tests for new functionality.
# Django imports.
from django.test import TestCase

# Application imports.
from conntrackt.forms import EntityForm


class EntityFormTest(TestCase):
    """
    Tests for the custom Entity model form.
    """

    def test_styling(self):
        """
        Test that the form styling is set-up correctly.
        """

        form = EntityForm()

        self.assertIn("span6", form.fields["name"].widget.attrs["class"])
        self.assertIn("span6", form.fields["description"].widget.attrs["class"])
        self.assertIn("span6", form.fields["project"].widget.attrs["class"])
        self.assertIn("span6", form.fields["location"].widget.attrs["class"])