diff --git a/tests/modeltests/empty/models.py b/tests/modeltests/empty/models.py index d57087134e1..a6cdb0aa227 100644 --- a/tests/modeltests/empty/models.py +++ b/tests/modeltests/empty/models.py @@ -7,20 +7,6 @@ no fields. 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 00000000000..01fa1c58cdc --- /dev/null +++ b/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()