Commit 1b8e5522 authored by Jérome Perrin's avatar Jérome Perrin

core_test: py3

parent c4e0f871
......@@ -28,6 +28,7 @@
#
##############################################################################
import io
import unittest
import os
from unittest import skip
......@@ -1050,14 +1051,12 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
import Products.ERP5Type
# tests that members can download files
class DummyFile(file):
def __init__(self, filename):
self.filename = os.path.basename(filename)
file.__init__(self, filename)
portal = self.getPortal()
class DummyFile(io.BytesIO):
filename = 'dummy.txt'
portal = self.portal
organisation = portal.organisation_module.newContent(portal_type='Organisation')
file_document = organisation.newContent(portal_type='Embedded File',
file=DummyFile(Products.ERP5Type.__file__),
file=DummyFile(b"data"),
content_type='text/plain')
# login as a member
......
......@@ -129,7 +129,7 @@ class TestQueryModule(ERP5TypeTestCase):
mfrom, mto, messageText = last_message
self.assertEqual('owner_user@example.invalid', mfrom)
self.assertEqual(['question_user@example.invalid'], mto)
self.assertTrue('Query' in messageText, messageText)
self.assertIn(b'Query', messageText)
def test_suite():
......
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