Пример #1
0
def request():
    req = mock.Mock(spec=['ip'])
    req.ip = request_ip()
    return req
Пример #2
0
def request_without_ip_x_forwarded_for():
    req = mock.Mock(spec=['environ'])
    req.environ = {'HTTP_X_FORWARDED_FOR': request_ip()}
    return req
Пример #3
0
def request_with_ip_cf_connecting_ip():
    req = mock.Mock(spec=['environ'])
    req.environ = {'HTTP_CF_CONNECTING_IP': request_ip_next()}
    return req
Пример #4
0
def request_without_ip_remote_addr():
    req = mock.Mock(spec=['environ'])
    req.environ = {'REMOTE_ADDR': request_ip()}
    return req
Пример #5
0
def request(env):
    req = mock.Mock()
    req.ip = request_ip()
    req.environ = env
    return req