mirror of https://github.com/scrapy/scrapy.git
refactor #3 Remove inner class in form test
This commit is contained in:
parent
bc036542a8
commit
877398a3de
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue