Esempio n. 1
0
def test_forms_CommentForm_text():
    data = 'text'
    form_data = {'comment': data}
    form = CommentForm(data=form_data)
    assert form.is_valid() == True
Esempio n. 2
0
def test_forms_CommentForm_field_help_text():
    form = CommentForm()
    assert form.fields['comment'].help_text == 'Введите комментарий'
Esempio n. 3
0
def test_forms_CommentForm_no_text():
    data = ''
    form_data = {'comment': data}
    form = CommentForm(data=form_data)
    assert form.is_valid() == False
Esempio n. 4
0
def test_forms_CommentForm_field_label():
    form = CommentForm()
    assert form.fields['comment'].label == None or form.fields[
        'comment'].label == 'comment'
Esempio n. 5
0
 def test_forms_CommentForm_field_label(self):
     form = CommentForm()
     self.assertTrue(form.fields['comment'].label == None
                     or form.fields['comment'].label == 'comment')
Esempio n. 6
0
 def test_forms_CommentForm_text(self):
     data = 'text'
     form_data = {'comment': data}
     form = CommentForm(data=form_data)
     self.assertTrue(form.is_valid())
Esempio n. 7
0
 def test_forms_CommentForm_no_text(self):
     data = ''
     form_data = {'comment': data}
     form = CommentForm(data=form_data)
     self.assertFalse(form.is_valid())
Esempio n. 8
0
 def test_forms_CommentForm_field_help_text(self):
     form = CommentForm()
     self.assertEqual(form.fields['comment'].help_text,
                      'Введите комментарий')