WIP: Why?
... | ... | @@ -56,6 +56,7 @@ class TestXForwardedFor(ERP5TypeTestCase): |
response = requests.get( | ||
'%s/%s' % (self.portal.absolute_url(), script_id), | ||
headers={'X-Forwarded-For': '1.2.3.4'}, | ||
timeout=5, | ||
|
||
) | ||
self.assertNotEqual(response.text, '1.2.3.4') | ||
last_line = get_Z2_log_last_line() | ||
... | ... | @@ -63,6 +64,7 @@ class TestXForwardedFor(ERP5TypeTestCase): |
response = requests.get( | ||
'%s/%s' % (self.portal.absolute_url(), script_id), | ||
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, '5.6.7.8') | ||
... | ... | @@ -71,6 +73,7 @@ class TestXForwardedFor(ERP5TypeTestCase): |
self.assertFalse(last_line.startswith('5.6.7.8 - '), last_line) | ||
response = requests.get( | ||
'%s/%s' % (self.portal.absolute_url(), script_id), | ||
timeout=5, | ||
) | ||
self.assertNotEqual(response.text, '1.2.3.4') | ||
last_line = get_Z2_log_last_line() | ||
... | ... | @@ -81,6 +84,7 @@ class TestXForwardedFor(ERP5TypeTestCase): |
response = requests.get( | ||
'%s/%s' % (self.portal.absolute_url(), script_id), | ||
headers={'X-Forwarded-For': '1.2.3.4'}, | ||
timeout=5, | ||
) | ||
self.assertEqual(response.text, '1.2.3.4') | ||
last_line = get_Z2_log_last_line() | ||
... | ... | @@ -88,12 +92,14 @@ class TestXForwardedFor(ERP5TypeTestCase): |
response = requests.get( | ||
'%s/%s' % (self.portal.absolute_url(), script_id), | ||
headers={'X-Forwarded-For': '1.2.3.4, 5.6.7.8'}, | ||
timeout=5, | ||
) | ||
self.assertEqual(response.text, '1.2.3.4') | ||
last_line = get_Z2_log_last_line() | ||
self.assertTrue(last_line.startswith('1.2.3.4 - '), last_line) | ||
response = requests.get( | ||
'%s/%s' % (self.portal.absolute_url(), script_id), | ||
timeout=5, | ||
) | ||
self.assertNotEqual(response.text, '1.2.3.4') | ||
last_line = get_Z2_log_last_line() | ||
... | ... |
... | ... | @@ -84,11 +84,12 @@ class TestWebDavSupport(ERP5TypeTestCase): |
person = self.portal.person_module.newContent() | ||
self.tic() | ||
file_object = self.makeFileUpload('images/erp5_logo.png') | ||
response = self.publish(person.getPath() + '/erp5_logo.png', | ||
request_method='PUT', | ||
stdin=file_object, | ||
basic=self.authentication) | ||
self.assertEqual(response.getStatus(), httplib.CREATED) | ||
response = self.publish( | ||
person.getPath() + '/erp5_logo.png', | ||
request_method='PUT', | ||
stdin=file_object, | ||
env={"CONTENT_TYPE": 'image/png'}, | ||
|
||
basic=self.authentication) | ||
self.assertEqual(response.getStatus(), six.moves.http_client.CREATED) | ||
image = person['erp5_logo.png'] | ||
self.assertEqual(image.getPortalType(), 'Embedded File') | ||
... | ... | @@ -104,10 +105,12 @@ class TestWebDavSupport(ERP5TypeTestCase): |
path = self.portal.portal_contributions.getPath() | ||
filename = 'P-DMS-Presentation.3.Pages-001-en.odp' | ||
file_object = self.makeFileUpload(filename) | ||
response = self.publish('%s/%s' % (path, filename), | ||
request_method='PUT', | ||
stdin=file_object, | ||
basic=self.authentication) | ||
response = self.publish( | ||
'%s/%s' % (path, filename), | ||
request_method='PUT', | ||
stdin=file_object, | ||
env={"CONTENT_TYPE": 'application/vnd.oasis.opendocument.presentation'}, | ||
basic=self.authentication) | ||
self.assertEqual(response.getStatus(), six.moves.http_client.CREATED) | ||
document_module = self.getDocumentModule() | ||
... | ... | @@ -126,10 +129,12 @@ class TestWebDavSupport(ERP5TypeTestCase): |
path = self.portal.portal_contributions.getPath() | ||
filename = 'P-DMS-Presentation.3.Pages-001-en.odp' | ||
file_object = self.makeFileUpload(filename) | ||
response = self.publish('%s/%s' % (path, filename), | ||
request_method='PUT', | ||
stdin=file_object, | ||
basic=self.authentication) | ||
response = self.publish( | ||
'%s/%s' % (path, filename), | ||
request_method='PUT', | ||
stdin=file_object, | ||
env={"CONTENT_TYPE": 'application/vnd.oasis.opendocument.presentation'}, | ||
basic=self.authentication) | ||
self.assertEqual(response.getStatus(), six.moves.http_client.CREATED) | ||
self.tic() | ||
... | ... | @@ -198,10 +203,12 @@ class TestWebDavSupport(ERP5TypeTestCase): |
path = self.portal.portal_contributions.getPath() | ||
filename = 'P-DMS-Presentation.3.Pages-001-en.odp' | ||
file_object = self.makeFileUpload(filename) | ||
response = self.publish('%s/%s' % (path, filename), | ||
request_method='PUT', | ||
stdin=file_object, | ||
basic=self.authentication) | ||
response = self.publish( | ||
'%s/%s' % (path, filename), | ||
request_method='PUT', | ||
stdin=file_object, | ||
env={"CONTENT_TYPE": 'application/vnd.oasis.opendocument.presentation'}, | ||
basic=self.authentication) | ||
# Convert to base format and run conversion into utf-8 | ||
self.tic() | ||
... | ... | @@ -225,10 +232,12 @@ class TestWebDavSupport(ERP5TypeTestCase): |
path = self.portal.portal_contributions.getPath() | ||
filename = 'P-DMS-Presentation.3.Pages-001-en.odp' | ||
file_object = self.makeFileUpload(filename) | ||
response = self.publish('%s/%s' % (path, filename), | ||
request_method='PUT', | ||
stdin=file_object, | ||
basic=self.authentication) | ||
response = self.publish( | ||
'%s/%s' % (path, filename), | ||
request_method='PUT', | ||
stdin=file_object, | ||
env={"CONTENT_TYPE": 'application/vnd.oasis.opendocument.presentation'}, | ||
basic=self.authentication) | ||
document_module = self.getDocumentModule() | ||
document = document_module[filename] | ||
... | ... | @@ -263,10 +272,12 @@ class TestWebDavSupport(ERP5TypeTestCase): |
path = self.portal.portal_contributions.getPath() | ||
filename = 'P-DMS-Presentation.3.Pages-001-en.odp' | ||
file_object = self.makeFileUpload(filename) | ||
response = self.publish('%s/%s' % (path, filename), | ||
request_method='PUT', | ||
stdin=file_object, | ||
basic=self.authentication) | ||
response = self.publish( | ||
'%s/%s' % (path, filename), | ||
request_method='PUT', | ||
stdin=file_object, | ||
env={"CONTENT_TYPE": 'application/vnd.oasis.opendocument.presentation'}, | ||
basic=self.authentication) | ||
document_module = self.getDocumentModule() | ||
document = document_module[filename] | ||
... | ... |