Author: PaulM
Date: 2010-06-21 21:56:53 -0500 (Mon, 21 Jun 2010)
New Revision: 13377

Added:
   django/branches/soc2010/test-refactor/tests/modeltests/empty/tests.py
Modified:
   django/branches/soc2010/test-refactor/tests/modeltests/empty/models.py
Log:
[soc2010/test-refactor] updated empty modeltest to unittest


Modified: django/branches/soc2010/test-refactor/tests/modeltests/empty/models.py
===================================================================
--- django/branches/soc2010/test-refactor/tests/modeltests/empty/models.py      
2010-06-22 02:56:25 UTC (rev 13376)
+++ django/branches/soc2010/test-refactor/tests/modeltests/empty/models.py      
2010-06-22 02:56:53 UTC (rev 13377)
@@ -9,18 +9,3 @@
 
 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()
-
-"""}

Added: django/branches/soc2010/test-refactor/tests/modeltests/empty/tests.py
===================================================================
--- django/branches/soc2010/test-refactor/tests/modeltests/empty/tests.py       
                        (rev 0)
+++ django/branches/soc2010/test-refactor/tests/modeltests/empty/tests.py       
2010-06-22 02:56:53 UTC (rev 13377)
@@ -0,0 +1,15 @@
+from django.test import TestCase
+
+from models import Empty
+
+class EmptyModelTestCase(TestCase):
+    def test_empty(self):
+        m = Empty()
+        self.assertEqual(m.id, None)
+        m.save()
+        m2 = Empty()
+        m2.save()
+        self.assertEqual(len(Empty.objects.all()), 2)
+        self.assertTrue(m.id is not None)
+        existing = Empty(m.id)
+        existing.save()

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to