Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

magic-removal: added a couple of constructor tests for model_inherita…

…nce.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2507 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7ec0ebc022e0eaf70d417729a084af80b258bcd9 1 parent 4b0fcef
Joseph Kocherhans jkocherhans authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 tests/modeltests/model_inheritance/models.py
15 tests/modeltests/model_inheritance/models.py
View
@@ -34,4 +34,19 @@ def __repr__(self):
>>> [f.name for f in ItalianRestaurant._meta.fields]
['id', 'name', 'address', 'serves_hot_dogs', 'serves_pizza', 'serves_gnocchi']
+# Create a couple of Places.
+>>> p1 = Place(name='Master Shakes', address='666 W. Jersey')
+>>> p1.save()
+>>> p2 = Place(name='Ace Hardware', address='1013 N. Ashland')
+>>> p2.save()
+
+# Test constructor for Restaurant.
+>>> r = Restaurant(name='Demon Dogs', address='944 W. Fullerton', serves_hot_dogs=True, serves_pizza=False)
+>>> r.save()
+
+# Test the constructor for ItalianRestaurant.
+>>> ir = ItalianRestaurant(name='Ristorante Miron', address='1234 W. Elm', serves_hot_dogs=False, serves_pizza=False, serves_gnocchi=True)
+>>> ir.save()
+
+
"""
Please sign in to comment.
Something went wrong with that request. Please try again.