django/tests/empty/tests.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
365 B
Python
Raw Normal View History

from django.test import TestCase
from .models import Empty
class EmptyModelTests(TestCase):
def test_empty(self):
m = Empty()
self.assertIsNone(m.id)
m.save()
Empty.objects.create()
self.assertEqual(len(Empty.objects.all()), 2)
self.assertIsNotNone(m.id)
existing = Empty(m.id)
existing.save()