refactor #3 Remove inner class in form test

This commit is contained in:
noon 2024-02-21 21:13:57 +01:00
parent bc036542a8
commit 877398a3de
1 changed files with 1 additions and 5 deletions

View File

@ -1452,12 +1452,8 @@ class FormRequestTest(RequestTest):
</body></html>"""
)
class CustomFormdata:
def __iter__(self):
raise ValueError("Custom iteration error for testing")
with self.assertRaises(ValueError) as context:
FormRequest.from_response(response, formdata=CustomFormdata())
FormRequest.from_response(response, formdata=("a",))
self.assertIn(
"formdata should be a dict or iterable of tuples", str(context.exception)