Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Migrated empty doctests. Thanks to Alex Gaynor.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13789 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 45651dcb05a863f87a440a895544736b5e8ba10a 1 parent 21e7987
@freakboy3742 freakboy3742 authored
Showing with 16 additions and 15 deletions.
  1. +1 −15 tests/modeltests/empty/models.py
  2. +15 −0 tests/modeltests/empty/tests.py
View
16 tests/modeltests/empty/models.py
@@ -7,20 +7,6 @@
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()
-
-"""}
View
15 tests/modeltests/empty/tests.py
@@ -0,0 +1,15 @@
+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()
Please sign in to comment.
Something went wrong with that request. Please try again.