summaryrefslogtreecommitdiff
path: root/tests/test_containers.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2012-01-12 23:21:38 +0100
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2012-01-12 23:21:38 +0100
commitc60c3106c700f5f42ad4fcf82f327da98ec5eb9e (patch)
tree570302046f68591b05a7178152c610917c71fe45 /tests/test_containers.py
parent0c4b9334c93170ce6df17506f48e3937090aec05 (diff)
downloadfactory-boy-c60c3106c700f5f42ad4fcf82f327da98ec5eb9e.tar
factory-boy-c60c3106c700f5f42ad4fcf82f327da98ec5eb9e.tar.gz
Add __repr__ / __str__ to a couple of objects.
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Diffstat (limited to 'tests/test_containers.py')
-rw-r--r--tests/test_containers.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_containers.py b/tests/test_containers.py
index effb060..6e58573 100644
--- a/tests/test_containers.py
+++ b/tests/test_containers.py
@@ -80,6 +80,15 @@ class LazyStubTestCase(unittest.TestCase):
self.assertRaises(containers.CyclicDefinitionError, getattr, stub, 'one')
+ def test_representation(self):
+ class RandomObj(object):
+ pass
+
+ stub = containers.LazyStub({'one': 1, 'two': 2}, target_class=RandomObj)
+ self.assertIn('RandomObj', repr(stub))
+ self.assertIn('RandomObj', str(stub))
+ self.assertIn('one', str(stub))
+
class OrderedDeclarationMock(declarations.OrderedDeclaration):
pass