summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/testmagicmethods.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/testmagicmethods.py b/tests/testmagicmethods.py
index 392ad96..d066b76 100644
--- a/tests/testmagicmethods.py
+++ b/tests/testmagicmethods.py
@@ -449,6 +449,12 @@ class TestMockingMagicMethods(unittest2.TestCase):
self.assertIsInstance(foo.__int__, Foo)
+ def test_descriptor_from_class(self):
+ m = MagicMock()
+ type(m).__str__.return_value = 'foo'
+ self.assertEqual(str(m), 'foo')
+
+
if __name__ == '__main__':
unittest2.main()