use REQUESTS_PROXIES instead of A2_FC_REQUESTS_PROXIES (#24929)
This commit is contained in:
parent
38cc81860e
commit
215c1f5abd
|
@ -108,10 +108,6 @@ class AppSettings(object):
|
|||
def scopes(self):
|
||||
return self._setting('SCOPES', [])
|
||||
|
||||
@property
|
||||
def requests_proxies(self):
|
||||
return self._setting('REQUESTS_PROXIES', {})
|
||||
|
||||
|
||||
import sys
|
||||
|
||||
|
|
|
@ -183,5 +183,5 @@ def requests_retry_session(
|
|||
session.mount('http://', adapter)
|
||||
session.mount('https://', adapter)
|
||||
# set proxies
|
||||
session.proxies.update(app_settings.requests_proxies)
|
||||
session.proxies.update(getattr(settings, 'REQUESTS_PROXIES', {}))
|
||||
return session
|
||||
|
|
|
@ -228,7 +228,7 @@ def test_requests_proxies_support(app, fc_settings, caplog):
|
|||
session = requests_retry_session(session=other_session)
|
||||
assert session is other_session
|
||||
assert session.proxies == {'http': 'http://example.net'}
|
||||
fc_settings.A2_FC_REQUESTS_PROXIES = {'https': 'http://pubproxy.com/api/proxy'}
|
||||
fc_settings.REQUESTS_PROXIES = {'https': 'http://pubproxy.com/api/proxy'}
|
||||
session = requests_retry_session()
|
||||
assert session.proxies == {'https': 'http://pubproxy.com/api/proxy'}
|
||||
|
||||
|
|
Reference in New Issue