0
0
mirror of https://github.com/django/django.git synced 2024-11-29 22:56:46 +01:00
django/tests/field_defaults/tests.py

18 lines
425 B
Python
Raw Normal View History

from datetime import datetime
from django.test import TestCase
2012-07-20 12:45:19 +02:00
from django.utils import six
from .models import Article
class DefaultTests(TestCase):
def test_field_defaults(self):
a = Article()
now = datetime.now()
a.save()
self.assertIsInstance(a.id, six.integer_types)
self.assertEqual(a.headline, "Default headline")
self.assertLess((now - a.pub_date).seconds, 5)