python3 compatibility
This commit is contained in:
parent
7a3251ddfc
commit
131951c976
@ -11,7 +11,7 @@ from isso.spam import Guard
|
|||||||
from isso.utils import Bloomfilter
|
from isso.utils import Bloomfilter
|
||||||
from isso.models import Comment
|
from isso.models import Comment
|
||||||
|
|
||||||
from isso.compat import string_types
|
from isso.compat import string_types, buffer
|
||||||
|
|
||||||
|
|
||||||
class Invalid(Exception):
|
class Invalid(Exception):
|
||||||
|
@ -32,7 +32,7 @@ class TestGuard(unittest.TestCase):
|
|||||||
controller.new(bob, thread, comment)
|
controller.new(bob, thread, comment)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
self.assertIsInstance(ex, comments.Denied)
|
self.assertIsInstance(ex, comments.Denied)
|
||||||
self.assertIn("ratelimit exceeded", ex.message)
|
self.assertIn("ratelimit exceeded", ex.args[0])
|
||||||
else:
|
else:
|
||||||
self.assertTrue(False)
|
self.assertTrue(False)
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ class TestGuard(unittest.TestCase):
|
|||||||
controller.new(bob, thread, comment)
|
controller.new(bob, thread, comment)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
self.assertIsInstance(ex, comments.Denied)
|
self.assertIsInstance(ex, comments.Denied)
|
||||||
self.assertIn("direct response", ex.message)
|
self.assertIn("direct response", ex.args[0])
|
||||||
else:
|
else:
|
||||||
self.assertTrue(False)
|
self.assertTrue(False)
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ class TestGuard(unittest.TestCase):
|
|||||||
controller.new(bob, thread, dict(text="...", parent=ref))
|
controller.new(bob, thread, dict(text="...", parent=ref))
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
self.assertIsInstance(ex, comments.Denied)
|
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:
|
else:
|
||||||
self.assertTrue(False)
|
self.assertTrue(False)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user