summaryrefslogtreecommitdiff
path: root/tests/modeltests/empty/models.py
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2006-06-19 15:23:57 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2006-06-19 15:23:57 +0000
commitadf4b9311d5d64a2bdd58da50271c121ea22e397 (patch)
treea69b3b023595cf1ce67a14c4c1ecd3290d94088e /tests/modeltests/empty/models.py
parente976ed1f7910fad03704f88853c5c5b36cbab134 (diff)
multi-auth: Merged to [3151]archive/attic/multi-auth
git-svn-id: http://code.djangoproject.com/svn/django/branches/multi-auth@3152 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests/empty/models.py')
-rw-r--r--tests/modeltests/empty/models.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/modeltests/empty/models.py b/tests/modeltests/empty/models.py
new file mode 100644
index 0000000000..c50878398d
--- /dev/null
+++ b/tests/modeltests/empty/models.py
@@ -0,0 +1,24 @@
+"""
+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()
+>>> m.id
+>>> m.save()
+>>> m2 = Empty()
+>>> m2.save()
+>>> len(Empty.objects.all())
+2
+>>> m.id is not None
+True
+
+"""