From 131951c9761993059e498ff3842e1314957c41cf Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Mon, 21 Jul 2014 23:24:22 +0200 Subject: [PATCH] python3 compatibility --- isso/controllers/comments.py | 2 +- isso/tests/test_spam.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/isso/controllers/comments.py b/isso/controllers/comments.py index cdd8bf6..0e48d00 100644 --- a/isso/controllers/comments.py +++ b/isso/controllers/comments.py @@ -11,7 +11,7 @@ from isso.spam import Guard from isso.utils import Bloomfilter from isso.models import Comment -from isso.compat import string_types +from isso.compat import string_types, buffer class Invalid(Exception): diff --git a/isso/tests/test_spam.py b/isso/tests/test_spam.py index 46a2341..9f26cac 100644 --- a/isso/tests/test_spam.py +++ b/isso/tests/test_spam.py @@ -32,7 +32,7 @@ class TestGuard(unittest.TestCase): controller.new(bob, thread, comment) except Exception as ex: self.assertIsInstance(ex, comments.Denied) - self.assertIn("ratelimit exceeded", ex.message) + self.assertIn("ratelimit exceeded", ex.args[0]) else: self.assertTrue(False) @@ -63,7 +63,7 @@ class TestGuard(unittest.TestCase): controller.new(bob, thread, comment) except Exception as ex: self.assertIsInstance(ex, comments.Denied) - self.assertIn("direct response", ex.message) + self.assertIn("direct response", ex.args[0]) else: self.assertTrue(False) @@ -79,7 +79,7 @@ class TestGuard(unittest.TestCase): controller.new(bob, thread, dict(text="...", parent=ref)) except Exception as ex: self.assertIsInstance(ex, comments.Denied) - self.assertIn("editing frame is still open", ex.message) + self.assertIn("editing frame is still open", ex.args[0]) else: self.assertTrue(False)