1
0
mirror of https://github.com/django/django.git synced 2024-12-25 18:46:22 +00:00
django/tests/modeltests/field_defaults/tests.py
2010-09-12 20:03:39 +00:00

17 lines
396 B
Python

from datetime import datetime
from django.test import TestCase
from models import Article
class DefaultTests(TestCase):
def test_field_defaults(self):
a = Article()
now = datetime.now()
a.save()
self.assertTrue(isinstance(a.id, (int, long)))
self.assertEqual(a.headline, "Default headline")
self.assertTrue((now - a.pub_date).seconds < 5)