Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 3
0
    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