def METHOD_NAME(self):
    req = Request("http://foo.example.com/")
    assert self.mw.process_request(req, self.spider) is None
    self.assertEqual(req.headers["Authorization"], basic_auth_header("foo", "bar"))