# Path: blog/models.py
# class Post(models.Model):
#     title = models.CharField(max_length=60)
#     tags = TaggableManager()
#     author = models.ForeignKey(User, null=True)
#     body = models.TextField()
#     created = models.DateTimeField(auto_now_add=True)
# 
#     class Meta:
#         ordering = ['-created']
# 
#     def __unicode__(self):
#         return self.title
#         return unicode(self.created)
# 
# class Comment(models.Model):
#     created = models.DateTimeField(auto_now_add=True)
#     name = models.CharField(max_length=60)
#     email = models.EmailField(max_length=35, null=True)
#     body = models.TextField()
#     post = models.ForeignKey(Post)
# 
#     class meta:
#         ordering = ['-created']
# 
#     def __unicode__(self):
#         return unicode("%s: %s" % (self.post, self.body[:60]))


import time
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from .models import Post, Comment




class BlogEntriesTest(TestCase):

    def setUp(self):
        self.c = Client()
        self.author = User.objects.create(username="Yashwanth",
                                          email="yashwanth@agiliq.com",
                                          password="yashwanth")
        self.post = Post.objects.create(author=self.author, title='Test',
                                        body='Testcase1',
                                        created=time.localtime()[:2])

# Path: blog/models.py
# class Post(models.Model):
#     title = models.CharField(max_length=60)
#     tags = TaggableManager()
#     author = models.ForeignKey(User, null=True)
#     body = models.TextField()
#     created = models.DateTimeField(auto_now_add=True)
# 
#     class Meta:
#         ordering = ['-created']
# 
#     def __unicode__(self):
#         return self.title
#         return unicode(self.created)
# 
# class Comment(models.Model):
#     created = models.DateTimeField(auto_now_add=True)
#     name = models.CharField(max_length=60)
#     email = models.EmailField(max_length=35, null=True)
#     body = models.TextField()
#     post = models.ForeignKey(Post)
# 
#     class meta:
#         ordering = ['-created']
# 
#     def __unicode__(self):
#         return unicode("%s: %s" % (self.post, self.body[:60]))


# Path: blog/tests.py
import time
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from .models import Post, Comment





class BlogEntriesTest(TestCase):

    def setUp(self):
        self.c = Client()
        self.author = User.objects.create(username="Yashwanth",
                                          email="yashwanth@agiliq.com",
                                          password="yashwanth")
        self.post = Post.objects.create(author=self.author, title='Test',
                                        body='Testcase1',
                                        created=time.localtime()[:2])

        self.comment = Comment.objects.create(post=self.post,