1
0
mirror of https://github.com/django/django.git synced 2024-12-29 12:36:08 +00:00
django/tests/field_defaults/tests.py
Marc Tamlyn 09f8652765 Use assertIsInstance in tests.
Gives much nicer errors when it fails.
2013-05-21 10:42:15 +01:00

20 lines
466 B
Python

from __future__ import absolute_import
from datetime import datetime
from django.test import TestCase
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.assertTrue((now - a.pub_date).seconds < 5)