1
0
mirror of https://github.com/django/django.git synced 2024-12-27 11:35:53 +00:00
django/tests/modeltests/empty/tests.py
Russell Keith-Magee 45651dcb05 Migrated empty doctests. Thanks to Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13789 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-12 20:05:07 +00:00

16 lines
381 B
Python

from django.test import TestCase
from models import Empty
class EmptyModelTests(TestCase):
def test_empty(self):
m = Empty()
self.assertEqual(m.id, None)
m.save()
m2 = Empty.objects.create()
self.assertEqual(len(Empty.objects.all()), 2)
self.assertTrue(m.id is not None)
existing = Empty(m.id)
existing.save()