Skip to content

Commit

Permalink
Use TypeError when appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
dyve committed May 3, 2021
1 parent 8185f28 commit ff2d2af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/django_bootstrap5/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class FieldRenderer(BaseRenderer):

def __init__(self, field, *args, **kwargs):
if not isinstance(field, BoundField):
raise ValueError('Parameter "field" should contain a valid Django BoundField.')
raise TypeError('Parameter "field" should contain a valid Django BoundField.')
self.field = field
super().__init__(*args, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_bootstrap_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SubjectTestForm(forms.Form):

class FieldTestCase(BootstrapTestCase):
def test_illegal_field(self):
with self.assertRaises(ValueError):
with self.assertRaises(TypeError):
self.render("{% bootstrap_field field %}", {"field": "illegal"})

def test_show_help(self):
Expand Down

0 comments on commit ff2d2af

Please sign in to comment.