예제 #1
0
    def test_make_comment(self, user):
        user = user.get()
        article = Article(user.profile, 'title', 'some body', description='some', isPublished='True')
        article.save()
        comment = Comment(article, user.profile, 'some body')
        comment.save()

        assert comment.article == article
        assert comment.author == user.profile
예제 #2
0
    def test_make_comment(self, user):
        user = user.get()
        article = Article(user.profile,
                          "title",
                          "some body",
                          description="some")
        article.save()
        comment = Comment(article, user.profile, "some body")
        comment.save()

        assert comment.article == article
        assert comment.author == user.profile
예제 #3
0
파일: test_models.py 프로젝트: rahulwa/ji
    def test_make_comments(self, user):
        user = user.get()
        article = Article(user.profile,
                          'title',
                          'some body',
                          description='some')
        article.save()
        comment = Comment(article, user.profile, 'some body')
        comment1 = Comment(article, user.profile, 'some body2')
        comment.save()
        comment1.save()

        assert comment.article == article
        assert comment.author == user.profile
        assert comment1.article == article
        assert comment1.author == user.profile
        assert len(article.comments.all()) == 2