thirdparty/google_appengine/lib/django/tests/modeltests/empty/models.py
author James Levy <jamesalexanderlevy@gmail.com>
Tue, 25 Aug 2009 15:58:21 +0200
changeset 2798 ec1857f0d0c7
parent 109 620f9b141567
permissions -rwxr-xr-x
Added SurveyRecordForm for viewing a SurveyRecord. This is subclassed into GradeSurveyRecord form for the GradingProjectSurveys. This should replace the need for the read_only kwarg in SurveyTakeForm. A TODO to try and extract this has been added. Fixes Issue 672. Reviewed by: Lennard de Rijk

"""
39. Empty model tests

These test that things behave sensibly for the rare corner-case of a model with
no fields.
"""

from django.db import models

class Empty(models.Model):
    pass

__test__ = {'API_TESTS':"""
>>> m = Empty()
>>> m.id
>>> m.save()
>>> m2 = Empty()
>>> m2.save()
>>> len(Empty.objects.all())
2
>>> m.id is not None
True
>>> existing = Empty(m.id)
>>> existing.save()

"""}