1. ollyc
  2. toffee

Commits

ollyc  committed a8a3dad

Added docstring to CallFactory

  • Participants
  • Parent commits 1d1df50
  • Branches default

Comments (0)

Files changed (1)

File src/toffee.py

View file
 
 
 class CallFactory(Factory):
+    """\
+    A factory that returns the value of a callable function or object.
+
+    Use this to lazily instantiate values that are accessible at setup
+    time but not necessarily earlier::
+
+        class fixture(Fixture):
+
+            user = CallFactory(lambda: User.objects.get(username='admin'))
+            ...
+
+    """
 
     def _create_object(self, context, args, kwargs):
         return self.what(*args, **kwargs)