Ticket #6706: 6706-tests-update-and-save.diff

File 6706-tests-update-and-save.diff, 904 bytes (added by Antti Kaihola, 16 years ago)

patch: adds a test case which updates one field and calls save() again

  • tests/modeltests/model_inheritance/models.py

     
    124124>>> p2.save()
    125125
    126126Test constructor for Restaurant.
    127 >>> r = Restaurant(name='Demon Dogs', address='944 W. Fullerton',serves_hot_dogs=True, serves_pizza=False, rating=2)
     127>>> r = Restaurant(name='Demon Dogs', address='944 W. Fullerton',serves_hot_dogs=True, serves_pizza=False, rating=1)
    128128>>> r.save()
    129129
     130# Update the instance by modifying a field and calling the save() command
     131# again.
     132>>> r.rating = 2
     133>>> r.save()
     134
    130135# Test the constructor for ItalianRestaurant.
    131136>>> ir = ItalianRestaurant(name='Ristorante Miron', address='1234 W. Elm', serves_hot_dogs=False, serves_pizza=False, serves_gnocchi=True, rating=4)
    132137>>> ir.save()
Back to Top