j2labs/schematics — pull request #214 by kstrauser (2014-05-07 02:35:06+00:00)
Title: Create mock objects using a class's fields as a template

This adds a `mock` method to `BaseType` descendants and a `get_mock_object` classmethod to `Model`s. The net effect is that you can call `MyClass.get_mock_object()` to get an instance populated with plausible, validateable data for use in unit testing.

Each of those methods accepts a `context` argument. Although none of the current `mock` methods use it, the intent is similar to the same argument in `to_primitive`.