PageRenderTime 56ms CodeModel.GetById 52ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/tests/modeltests/empty/tests.py

https://code.google.com/p/mango-py/
Python | 15 lines | 12 code | 3 blank | 0 comment | 1 complexity | 70809221f63b0c67b505090ec51272c8 MD5 | raw file
 1from django.test import TestCase
 2
 3from models import Empty
 4
 5
 6class EmptyModelTests(TestCase):
 7    def test_empty(self):
 8        m = Empty()
 9        self.assertEqual(m.id, None)
10        m.save()
11        m2 = Empty.objects.create()
12        self.assertEqual(len(Empty.objects.all()), 2)
13        self.assertTrue(m.id is not None)
14        existing = Empty(m.id)
15        existing.save()