Ticket #6755: models.py

File models.py, 523 bytes (added by sloonz, 16 years ago)

Regression test

Line 
1# coding: utf-8
2from django.db import models
3
4class Place(models.Model):
5 name = models.CharField(max_length=50)
6 address = models.CharField(max_length=80)
7
8class Restaurant(Place):
9 serves_hot_dogs = models.BooleanField()
10 serves_pizza = models.BooleanField()
11
12__test__ = {'API_TESTS': """
13# #6755 regression test
14>>> r = Restaurant(serves_pizza = False)
15>>> r.save()
16>>> r.id
171
18>>> r.place_ptr_id
191
20>>> r = Restaurant(place_ptr_id = 1, serves_pizza = True)
21>>> r.save()
22>>> r.id
231
24>>> r.place_ptr_id
251
26
27"""
28}
Back to Top