summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul McMillan <Paul@McMillan.ws>2010-06-22 02:56:53 +0000
committerPaul McMillan <Paul@McMillan.ws>2010-06-22 02:56:53 +0000
commit52a855fd37c6e9765aedf9178d9e85c3c669c0c1 (patch)
treed8544761482d952c7e236e94e053fb1f72d3c11a
parent85f024c2b1d9b59d0a487f0743da8c21076064b7 (diff)
[soc2010/test-refactor] updated empty modeltest to unittest
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/test-refactor@13377 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--tests/modeltests/empty/models.py15
-rw-r--r--tests/modeltests/empty/tests.py15
2 files changed, 15 insertions, 15 deletions
diff --git a/tests/modeltests/empty/models.py b/tests/modeltests/empty/models.py
index d57087134e..32bb294406 100644
--- a/tests/modeltests/empty/models.py
+++ b/tests/modeltests/empty/models.py
@@ -9,18 +9,3 @@ 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()
-
-"""}
diff --git a/tests/modeltests/empty/tests.py b/tests/modeltests/empty/tests.py
new file mode 100644
index 0000000000..6e262832da
--- /dev/null
+++ b/tests/modeltests/empty/tests.py
@@ -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()