Commit 6ee898b6 authored by Julien Muchembled's avatar Julien Muchembled

erp5_web_shadir: update tests

See commit c45c2295
("erp5_web_shadir: more useful checks").
parent 49dd1c9b
Pipeline #26465 failed with stage
in 0 seconds
...@@ -27,11 +27,11 @@ ...@@ -27,11 +27,11 @@
# #
############################################################################## ##############################################################################
import base64
import hashlib import hashlib
import json import json
import platform import platform
import random import random
from base64 import b64encode
from DateTime import DateTime from DateTime import DateTime
...@@ -65,14 +65,14 @@ class ShaDirMixin(object): ...@@ -65,14 +65,14 @@ class ShaDirMixin(object):
'expiration_date': str(self.expiration_date), 'expiration_date': str(self.expiration_date),
'distribution': self.distribution, 'distribution': self.distribution,
'architecture': self.architecture}), 'architecture': self.architecture}),
"User SIGNATURE goes here."] b64encode("User SIGNATURE goes here.")]
self.data = json.dumps(self.data_list) self.data = json.dumps(self.data_list)
self.sha512sum = hashlib.sha512(self.data).hexdigest() self.sha512sum = hashlib.sha512(self.data).hexdigest()
self.header_dict = { self.header_dict = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Authorization': 'Basic %s' % (base64.encodestring('ERP5TypeTestCase:').strip()) 'Authorization': 'Basic ' + b64encode('ERP5TypeTestCase:'),
} }
module = self.portal.web_site_module module = self.portal.web_site_module
......
...@@ -32,6 +32,7 @@ import httplib ...@@ -32,6 +32,7 @@ import httplib
import urlparse import urlparse
import json import json
import random import random
from base64 import b64encode
from unittest import expectedFailure from unittest import expectedFailure
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from erp5.component.test.ShaDirMixin import ShaDirMixin from erp5.component.test.ShaDirMixin import ShaDirMixin
...@@ -224,7 +225,7 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -224,7 +225,7 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
'expiration_date': str(self.expiration_date), 'expiration_date': str(self.expiration_date),
'distribution': self.distribution, 'distribution': self.distribution,
'architecture': self.architecture}), 'architecture': self.architecture}),
"User SIGNATURE goes here."] b64encode("User SIGNATURE goes here.")]
data_2 = json.dumps(data_list_2) data_2 = json.dumps(data_list_2)
self.postInformation(key_2, data_2) self.postInformation(key_2, data_2)
self.tic() self.tic()
......
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