示例#1
0
 def test_returns_populated_dict_when_http_proxy_is_set(self):
     Config.objects.set_config("enable_http_proxy", True)
     url = factory.make_parsed_url().geturl()
     Config.objects.set_config("http_proxy", url)
     self.assertEqual(
         {"http": urlparse(url), "https": urlparse(url)}, get_proxies()
     )
示例#2
0
 def test_returns_populated_dict_when_http_proxy_is_disabled(self):
     Config.objects.set_config("enable_http_proxy", False)
     url = factory.make_parsed_url().geturl()
     Config.objects.set_config("http_proxy", url)
     self.assertEqual({"http": None, "https": None}, get_proxies())
示例#3
0
 def test_returns_populated_dict_when_http_proxy_is_not_set(self):
     Config.objects.set_config("enable_http_proxy", True)
     Config.objects.set_config("http_proxy", None)
     self.assertEqual({"http": None, "https": None}, get_proxies())