mirror of
https://github.com/django/django.git
synced 2024-11-19 16:04:13 +00:00
521be8cd9c
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13779 bcc190cf-cafb-0310-a4f2-bffc1f526a37
17 lines
396 B
Python
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)
|