Skip to content

Commit 91051e9

Browse files
author
Ryan P Kilby
committed
Update unknown fields test to handle multiple fields
1 parent 4b5bc1a commit 91051e9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_filterset.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,12 @@ class F(FilterSet):
428428
class Meta:
429429
model = Book
430430
fields = ('username', 'price', 'other', 'another')
431-
self.assertEqual(excinfo.exception.args, (
432-
"Meta.fields contains a field that isn't defined "
433-
"on this FilterSet: other",))
431+
432+
self.assertEqual(
433+
str(excinfo.exception),
434+
"'Meta.fields' contains fields that are not defined on this FilterSet: "
435+
"other, another"
436+
)
434437

435438
def test_meta_fields_dictionary_containing_unknown(self):
436439
with self.assertRaises(TypeError):

0 commit comments

Comments
 (0)