Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.2.X] Migrated empty doctests. Thanks to Alex Gaynor.

Backport of r13789 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13806 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 411f8dc0d62eb3e3311a504b9262ed3d0c68b482 1 parent cbcdd40
Russell Keith-Magee authored September 12, 2010
16  tests/modeltests/empty/models.py
@@ -7,20 +7,6 @@
7 7
 
8 8
 from django.db import models
9 9
 
  10
+
10 11
 class Empty(models.Model):
11 12
     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  
-"""}
15  tests/modeltests/empty/tests.py
... ...
@@ -0,0 +1,15 @@
  1
+from django.test import TestCase
  2
+
  3
+from models import Empty
  4
+
  5
+
  6
+class EmptyModelTests(TestCase):
  7
+    def test_empty(self):
  8
+        m = Empty()
  9
+        self.assertEqual(m.id, None)
  10
+        m.save()
  11
+        m2 = Empty.objects.create()
  12
+        self.assertEqual(len(Empty.objects.all()), 2)
  13
+        self.assertTrue(m.id is not None)
  14
+        existing = Empty(m.id)
  15
+        existing.save()

0 notes on commit 411f8dc

Please sign in to comment.
Something went wrong with that request. Please try again.