from django.test import LiveServerTestCase, Client
from .models import Document


class DocumentTest(LiveServerTestCase):
    def setUp(self):
        self.test_public_doc = Document.objects.create(
            title="DocumentTest Title",
            content="DocumentTest Content content",
            meta_tag="metametametametametametametameta",
            public_doc=True)
        
        self.test_private_doc = Document.objects.create(
            title="DocumentTest private",
            content="DocumentTest Content content",
            meta_tag="metametametametametametametameta",
            public_doc=False)

    def test_public_doc(self):
        c = Client()
        response = c.get("/lifeblog/")
        self.assertEquals(200, response.status_code)
        self.assertIn(self.test_public_doc.title, response.content.decode())
        self.assertNotIn(
            self.test_private_doc.title, response.content.decode())

    def test_document_detail(self):
        c = Client()
        response = c.get("/lifeblog/1")
        self.assertEquals(200, response.status_code)
        self.assertIn(self.test_public_doc.title, response.content.decode())

@@ -713,61 +713,8 @@
 /%22)%0A
-        self.assertEquals(200, response.status_code)%0A
     
@@ -978,10 +978,35 @@
 log/
-1
 %22
+ + self.test_public_doc.pk
 )%0A  

update test code