def test_form_for_short_text(self): """ Form should recieve len(text) >= 10 note: author is not required field, can be NULL """ form_data = {'title': '12345'} form_data['text'] = 'less t 10' form = NoteForm(data=form_data) self.assertEqual(form.is_valid(), False)
def test_form_for_normal_title_and_text(self): """ Form should recieve on len(title) >= 5 and len(text) >= 10 note: author is not required field, can be NULL """ form_data = {'title': '12345'} form_data['text'] = 'more then ten symbols here' form = NoteForm(data=form_data) self.assertEqual(form.is_valid(), True)
def test_form_for_short_title(self): """ Form should recieve len(title) >= 5 note: author is not required field, can be NULL """ form_data = {'title': '123'} form_data['text'] = 'more then ten symbols here' form = NoteForm(data=form_data) self.assertEqual(form.is_valid(), False)