2010-09-12 20:05:07 +00:00
|
|
|
from django.test import TestCase
|
|
|
|
|
2011-10-13 18:04:12 +00:00
|
|
|
from .models import Empty
|
2010-09-12 20:05:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
class EmptyModelTests(TestCase):
|
|
|
|
def test_empty(self):
|
|
|
|
m = Empty()
|
2014-10-28 10:02:56 +00:00
|
|
|
self.assertIsNone(m.id)
|
2010-09-12 20:05:07 +00:00
|
|
|
m.save()
|
2012-09-07 17:17:09 +00:00
|
|
|
Empty.objects.create()
|
2010-09-12 20:05:07 +00:00
|
|
|
self.assertEqual(len(Empty.objects.all()), 2)
|
2014-10-28 10:02:56 +00:00
|
|
|
self.assertIsNotNone(m.id)
|
2010-09-12 20:05:07 +00:00
|
|
|
existing = Empty(m.id)
|
|
|
|
existing.save()
|