2006-06-08 00:13:52 +00:00
|
|
|
"""
|
|
|
|
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
|
|
|
|
|
|
|
|
API_TESTS = """
|
|
|
|
>>> m = Empty()
|
2006-06-12 12:49:14 +00:00
|
|
|
>>> m.id
|
2006-06-08 00:13:52 +00:00
|
|
|
>>> m.save()
|
2006-06-08 15:15:27 +00:00
|
|
|
>>> m2 = Empty()
|
|
|
|
>>> m2.save()
|
|
|
|
>>> len(Empty.objects.all())
|
|
|
|
2
|
2006-06-12 12:49:14 +00:00
|
|
|
>>> m.id is not None
|
|
|
|
True
|
2006-08-10 03:55:03 +00:00
|
|
|
>>> existing = Empty(m.id)
|
|
|
|
>>> existing.save()
|
2006-06-08 00:13:52 +00:00
|
|
|
|
|
|
|
"""
|