mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 08:47:40 +00:00
Apply 2to3 automatic migration
This commit is contained in:
@@ -20,7 +20,7 @@ class TestAttachmentSwift(TestIrAttachment):
|
|||||||
def test_connection(self):
|
def test_connection(self):
|
||||||
""" Test the connection to the Swift object store """
|
""" Test the connection to the Swift object store """
|
||||||
conn = self.Attachment._get_swift_connection()
|
conn = self.Attachment._get_swift_connection()
|
||||||
self.assertNotEquals(conn, False)
|
self.assertNotEqual(conn, False)
|
||||||
|
|
||||||
def test_store_file_on_swift(self):
|
def test_store_file_on_swift(self):
|
||||||
""" Test writing a file and then reading it """
|
""" Test writing a file and then reading it """
|
||||||
@@ -28,7 +28,7 @@ class TestAttachmentSwift(TestIrAttachment):
|
|||||||
set_param('ir_attachment.location', 'swift'))
|
set_param('ir_attachment.location', 'swift'))
|
||||||
a5 = self.Attachment.create({'name': 'a5', 'datas': self.blob1_b64})
|
a5 = self.Attachment.create({'name': 'a5', 'datas': self.blob1_b64})
|
||||||
a5bis = self.Attachment.browse(a5.id)[0]
|
a5bis = self.Attachment.browse(a5.id)[0]
|
||||||
self.assertEquals(a5.datas, a5bis.datas)
|
self.assertEqual(a5.datas, a5bis.datas)
|
||||||
|
|
||||||
def test_delete_file_on_swift(self):
|
def test_delete_file_on_swift(self):
|
||||||
""" Create a file and then test the deletion """
|
""" Create a file and then test the deletion """
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ class RedisSessionStore(SessionStore):
|
|||||||
self.expiration = DEFAULT_SESSION_TIMEOUT
|
self.expiration = DEFAULT_SESSION_TIMEOUT
|
||||||
else:
|
else:
|
||||||
self.expiration = expiration
|
self.expiration = expiration
|
||||||
self.prefix = u'session:'
|
self.prefix = 'session:'
|
||||||
if prefix:
|
if prefix:
|
||||||
self.prefix = u'%s:%s:' % (
|
self.prefix = '%s:%s:' % (
|
||||||
self.prefix, prefix
|
self.prefix, prefix
|
||||||
)
|
)
|
||||||
|
|
||||||
def build_key(self, sid):
|
def build_key(self, sid):
|
||||||
if isinstance(sid, unicode):
|
if isinstance(sid, str):
|
||||||
sid = sid.encode('utf-8')
|
sid = sid.encode('utf-8')
|
||||||
return '%s%s' % (self.prefix, sid)
|
return '%s%s' % (self.prefix, sid)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user