diff options
| author | David Cramer <dcramer@gmail.com> | 2012-02-12 20:41:25 -0800 |
|---|---|---|
| committer | David Cramer <dcramer@gmail.com> | 2012-02-12 20:41:25 -0800 |
| commit | 75968cfb656d670e7e9620f446d36ab9dad63abd (patch) | |
| tree | a6761f076ebd95e0e708c0142768ea25bed6dae1 /tests/utils/encoding | |
| parent | 78d1f44cbe65acbe85e2d7001a8d258116a2faf3 (diff) | |
| download | raven-75968cfb656d670e7e9620f446d36ab9dad63abd.tar.gz | |
Add test for bad repr
Diffstat (limited to 'tests/utils/encoding')
| -rw-r--r-- | tests/utils/encoding/tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/utils/encoding/tests.py b/tests/utils/encoding/tests.py index 9b8ef00..580da64 100644 --- a/tests/utils/encoding/tests.py +++ b/tests/utils/encoding/tests.py @@ -123,6 +123,16 @@ class TransformTest(TestCase): result = transform(x) self.assertEquals(result, 'example') + def test_broken_repr(self): + class Foo(object): + def __repr__(self): + raise ValueError + + x = Foo() + + result = transform(x) + self.assertEquals(result, u"<BadRepr: <class 'tests.utils.encoding.tests.Foo'>>") + class ShortenTest(TestCase): def test_shorten_string(self): |
