Code

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

File 6706-tests-update-and-save.diff, 904 bytes (added by akaihola, 6 years ago)

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

Line 
1Index: tests/modeltests/model_inheritance/models.py
2===================================================================
3--- tests/modeltests/model_inheritance/models.py        (revision 7206)
4+++ tests/modeltests/model_inheritance/models.py        (working copy)
5@@ -124,9 +124,14 @@
6 >>> p2.save()
7 
8 Test constructor for Restaurant.
9->>> r = Restaurant(name='Demon Dogs', address='944 W. Fullerton',serves_hot_dogs=True, serves_pizza=False, rating=2)
10+>>> r = Restaurant(name='Demon Dogs', address='944 W. Fullerton',serves_hot_dogs=True, serves_pizza=False, rating=1)
11 >>> r.save()
12 
13+# Update the instance by modifying a field and calling the save() command
14+# again.
15+>>> r.rating = 2
16+>>> r.save()
17+
18 # Test the constructor for ItalianRestaurant.
19 >>> ir = ItalianRestaurant(name='Ristorante Miron', address='1234 W. Elm', serves_hot_dogs=False, serves_pizza=False, serves_gnocchi=True, rating=4)
20 >>> ir.save()