mirror of
https://github.com/django/django.git
synced 2025-07-05 18:29:11 +00:00
magic-removal: added a couple of constructor tests for model_inheritance.
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2507 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4b0fcefbc2
commit
7ec0ebc022
@ -34,4 +34,19 @@ API_TESTS = """
|
|||||||
>>> [f.name for f in ItalianRestaurant._meta.fields]
|
>>> [f.name for f in ItalianRestaurant._meta.fields]
|
||||||
['id', 'name', 'address', 'serves_hot_dogs', 'serves_pizza', 'serves_gnocchi']
|
['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()
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user