Files
python-tdd/src/apps/dashboard/tests/unit/test_forms.py

14 lines
360 B
Python
Raw Normal View History

from django.test import SimpleTestCase
from apps.dashboard.forms import (
EMPTY_LINE_ERROR,
LineForm,
)
class SimpleLineFormTest(SimpleTestCase):
def test_form_validation_for_blank_lines(self):
form = LineForm(data={"text": ""})
self.assertFalse(form.is_valid())
self.assertEqual(form.errors["text"], [EMPTY_LINE_ERROR])