Python factory 模块,fuzzy() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用factory.fuzzy()

项目:eventit    作者:alfredgg    | 项目源码 | 文件源码
def generate_data(n_users=25, n_events=100):
    users = UserFactory.create_batch(size=n_users)
    models.db.session.bulk_save_objects(users)

    EventFactory.owner_id = factory.fuzzy.FuzzyInteger(1, n_users)  # FIXME: Use a sub-factory or something
    events = EventFactory.create_batch(size=n_events)
    models.db.session.bulk_save_objects(events)

    models.db.session.commit()