thirdparty/google_appengine/lib/django/tests/modeltests/empty/models.py
changeset 2866 a04b1e4126c4
parent 2864 2e0b0af889be
child 2868 9f7f269383f7
equal deleted inserted replaced
2864:2e0b0af889be 2866:a04b1e4126c4
     1 """
       
     2 39. Empty model tests
       
     3 
       
     4 These test that things behave sensibly for the rare corner-case of a model with
       
     5 no fields.
       
     6 """
       
     7 
       
     8 from django.db import models
       
     9 
       
    10 class Empty(models.Model):
       
    11     pass
       
    12 
       
    13 __test__ = {'API_TESTS':"""
       
    14 >>> m = Empty()
       
    15 >>> m.id
       
    16 >>> m.save()
       
    17 >>> m2 = Empty()
       
    18 >>> m2.save()
       
    19 >>> len(Empty.objects.all())
       
    20 2
       
    21 >>> m.id is not None
       
    22 True
       
    23 >>> existing = Empty(m.id)
       
    24 >>> existing.save()
       
    25 
       
    26 """}