PyQuery would probably do a better job here:

```python
doc = pq(response.content)
inputs = doc.find('input[name=toc_depth]')
eq_(1, inputs.length)
input = inputs[0]
eq_('hidden', input.type)
eq_('0', input.value)
```