factory_boy






factory_boy is a fixtures replacement based on thoughtbot's factory_bot .
As a fixtures replacement tool, it aims to replace static, hard to maintain fixtures
with easy-to-use factories for complex objects.
Instead of building an exhaustive test setup with every possible combination of corner cases,
factory_boy allows you to use objects customized for the current test,
while only declaring the test-specific fields:
class FooTests(unittest.TestCase):
def test_with_factory_boy(self):
# We need a 200€, paid order, shipping to australia, for a VIP customer
order = OrderFactory(
amount=200,
status='PAID',