Commit e2a4c638 authored by Jérome Perrin's avatar Jérome Perrin

testConstraint: py3

parent 0792c5c8
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
# #
############################################################################## ##############################################################################
import six
import unittest import unittest
from unittest import expectedFailure from unittest import expectedFailure
...@@ -1490,15 +1491,16 @@ class TestConstraint(PropertySheetTestCase): ...@@ -1490,15 +1491,16 @@ class TestConstraint(PropertySheetTestCase):
# the error message. # the error message.
error_list = person.checkConsistency() error_list = person.checkConsistency()
self.assertEqual(1, len(error_list)) self.assertEqual(1, len(error_list))
self.assertEqual("Attribute source_title should be of type string but is of type <type 'int'>", expected_message = "Attribute source_title should be of type string but is of type <class 'int'>"
str(error_list[0].getMessage())) if six.PY2:
expected_message = "Attribute source_title should be of type string but is of type <type 'int'>"
self.assertEqual(str(error_list[0].getMessage()), expected_message)
self.stepLoginAsAssignee() self.stepLoginAsAssignee()
# Assignee cannot access testGroup3, so full information is not # Assignee cannot access testGroup3, so full information is not
# included in the error message. # included in the error message.
error_list = person.checkConsistency() error_list = person.checkConsistency()
self.assertEqual(1, len(error_list)) self.assertEqual(1, len(error_list))
self.assertNotEqual("Attribute source_title should be of type string but is of type <type 'int'>", self.assertEqual(str(error_list[0].getMessage()), 'There is something wrong.')
str(error_list[0].getMessage()))
def test_PropertyTypeValidityForMultivaluedProperty(self): def test_PropertyTypeValidityForMultivaluedProperty(self):
""" """
......
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