def test_get_with_help_text(self):
     field = get_form_field(Article, 'title', help_text='foo')
     assert field.help_text == 'foo'
 def test_get_with_widget(self):
     field = get_form_field(Article, 'title', widget=forms.Textarea)
     assert isinstance(field.widget, forms.Textarea)
 def test_get_with_label(self):
     field = get_form_field(Article, 'title', label='foo')
     assert field.label == 'foo'
 def test_get_field(self):
     field = get_form_field(Article, 'title')
     assert isinstance(field, forms.CharField)
 def test_get_related_field(self):
     field = get_form_field(Article, 'author__name')
     assert isinstance(field, forms.CharField)
 def test_get_with_help_text(self):
     field = get_form_field(Article, 'title', help_text='foo')
     assert field.help_text == 'foo'
 def test_get_with_label(self):
     field = get_form_field(Article, 'title', label='foo')
     assert field.label == 'foo'
 def test_get_with_widget(self):
     field = get_form_field(Article, 'title', widget=forms.Textarea)
     assert isinstance(field.widget, forms.Textarea)
 def test_get_related_field(self):
     field = get_form_field(Article, 'author__name')
     assert isinstance(field, forms.CharField)
Exemple #10
0
 def test_get_field(self):
     field = get_form_field(Article, 'title')
     assert isinstance(field, forms.CharField)