Commit 735600e2 authored by Arnaud Fontaine's avatar Arnaud Fontaine

WIP: Why?

parent dba378d6
...@@ -56,6 +56,7 @@ class TestXForwardedFor(ERP5TypeTestCase): ...@@ -56,6 +56,7 @@ class TestXForwardedFor(ERP5TypeTestCase):
response = requests.get( response = requests.get(
'%s/%s' % (self.portal.absolute_url(), script_id), '%s/%s' % (self.portal.absolute_url(), script_id),
headers={'X-Forwarded-For': '1.2.3.4'}, headers={'X-Forwarded-For': '1.2.3.4'},
timeout=5,
) )
self.assertNotEqual(response.text, '1.2.3.4') self.assertNotEqual(response.text, '1.2.3.4')
last_line = get_Z2_log_last_line() last_line = get_Z2_log_last_line()
...@@ -63,6 +64,7 @@ class TestXForwardedFor(ERP5TypeTestCase): ...@@ -63,6 +64,7 @@ class TestXForwardedFor(ERP5TypeTestCase):
response = requests.get( response = requests.get(
'%s/%s' % (self.portal.absolute_url(), script_id), '%s/%s' % (self.portal.absolute_url(), script_id),
headers={'X-Forwarded-For': '1.2.3.4, 5.6.7.8'}, headers={'X-Forwarded-For': '1.2.3.4, 5.6.7.8'},
timeout=5,
) )
self.assertNotEqual(response.text, '1.2.3.4') self.assertNotEqual(response.text, '1.2.3.4')
self.assertNotEqual(response.text, '5.6.7.8') self.assertNotEqual(response.text, '5.6.7.8')
...@@ -71,6 +73,7 @@ class TestXForwardedFor(ERP5TypeTestCase): ...@@ -71,6 +73,7 @@ class TestXForwardedFor(ERP5TypeTestCase):
self.assertFalse(last_line.startswith('5.6.7.8 - '), last_line) self.assertFalse(last_line.startswith('5.6.7.8 - '), last_line)
response = requests.get( response = requests.get(
'%s/%s' % (self.portal.absolute_url(), script_id), '%s/%s' % (self.portal.absolute_url(), script_id),
timeout=5,
) )
self.assertNotEqual(response.text, '1.2.3.4') self.assertNotEqual(response.text, '1.2.3.4')
last_line = get_Z2_log_last_line() last_line = get_Z2_log_last_line()
...@@ -81,6 +84,7 @@ class TestXForwardedFor(ERP5TypeTestCase): ...@@ -81,6 +84,7 @@ class TestXForwardedFor(ERP5TypeTestCase):
response = requests.get( response = requests.get(
'%s/%s' % (self.portal.absolute_url(), script_id), '%s/%s' % (self.portal.absolute_url(), script_id),
headers={'X-Forwarded-For': '1.2.3.4'}, headers={'X-Forwarded-For': '1.2.3.4'},
timeout=5,
) )
self.assertEqual(response.text, '1.2.3.4') self.assertEqual(response.text, '1.2.3.4')
last_line = get_Z2_log_last_line() last_line = get_Z2_log_last_line()
...@@ -88,12 +92,14 @@ class TestXForwardedFor(ERP5TypeTestCase): ...@@ -88,12 +92,14 @@ class TestXForwardedFor(ERP5TypeTestCase):
response = requests.get( response = requests.get(
'%s/%s' % (self.portal.absolute_url(), script_id), '%s/%s' % (self.portal.absolute_url(), script_id),
headers={'X-Forwarded-For': '1.2.3.4, 5.6.7.8'}, headers={'X-Forwarded-For': '1.2.3.4, 5.6.7.8'},
timeout=5,
) )
self.assertEqual(response.text, '1.2.3.4') self.assertEqual(response.text, '1.2.3.4')
last_line = get_Z2_log_last_line() last_line = get_Z2_log_last_line()
self.assertTrue(last_line.startswith('1.2.3.4 - '), last_line) self.assertTrue(last_line.startswith('1.2.3.4 - '), last_line)
response = requests.get( response = requests.get(
'%s/%s' % (self.portal.absolute_url(), script_id), '%s/%s' % (self.portal.absolute_url(), script_id),
timeout=5,
) )
self.assertNotEqual(response.text, '1.2.3.4') self.assertNotEqual(response.text, '1.2.3.4')
last_line = get_Z2_log_last_line() last_line = get_Z2_log_last_line()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment