def records():
    Person.create(name='jjy', age=25)
    Person.create(name='Hari Seldon', age=60)
    Person.create(name='Anders', age=80)
    Person.create(name='Henry', age=30)
    Person.create(name='Henry', age=27)
    yield
    Person.delete_all()
Exemple #2
0
def records():
    p = Person.create(name='jjy', age=25)
    p2 = Person.create(name='simon', age=45)
    p.pets.create(name='pipi', age=2)
    p.pets.create(name='cola', age=1)
    p2.pets.create(name='penguin', age=1)
    yield
    Person.delete_all()
    Pet.delete_all()