-
-
Notifications
You must be signed in to change notification settings - Fork 672
Expand file tree
/
Copy pathtest_models.py
More file actions
24 lines (19 loc) · 670 Bytes
/
test_models.py
File metadata and controls
24 lines (19 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from django.test import TestCase
from django.utils import timezone
from apps.blogs.models import BlogEntry, Feed
class BlogModelTest(TestCase):
def test_blog_entry(self):
now = timezone.now()
b = BlogEntry.objects.create(
title="Test Entry",
summary="Test Summary",
pub_date=now,
url="http://www.revsys.com",
feed=Feed.objects.create(
name="psf blog",
website_url="psf.example.org",
feed_url="feed.psf.example.org",
),
)
self.assertEqual(str(b), b.title)
self.assertEqual(b.get_absolute_url(), b.url)