def test_factory_repr(): assert repr(Factory(Author)) == "Factory(Author)" assert repr(Factory(Author, name="foo")) == "Factory(Author, name='foo')"
def chapter_factory(request): return Factory(Chapter)(request)
def model_b_factory(request): """Please note that a factory function for ModelA is missing intentionally.""" return Factory(ModelB)(request)
def broken_factory(request): return Factory(Book, author=SubFactory("bill_watterson"))(request)
def watterson_book_factory(request, watterson_author_factory): """This factory builds objects with "Bill Watterson" as default author.""" return Factory(Book, author=SubFactory("watterson_author_factory"))(request)
def watterson_author_factory(request): return Factory(Author, name="Bill Watterson")(request)
def book_factory(request): return Factory(Book, title="Default Title")(request)
def author_factory(request): factory = Factory(Author, name="Default Author") return factory(request)