示例#1
0
文件: test_models.py 项目: rahulwa/ji
    def test_unfavorite_an_article(self):
        u1 = User('foo', '*****@*****.**')
        u1.save()
        p1 = UserProfile(u1)
        p1.save()

        u2 = User('foo1', '*****@*****.**')
        u2.save()
        p2 = UserProfile(u2)
        p2.save()

        article = Article(p1, 'title', 'some body', description='some')
        article.save()
        assert article.favourite(p1)
        assert article.unfavourite(p1)
        assert not article.is_favourite(p1)
示例#2
0
    def test_unfavorite_an_article(self):
        u1 = User("foo", "*****@*****.**")
        u1.save()
        p1 = UserProfile(u1)
        p1.save()

        u2 = User("foo1", "*****@*****.**")
        u2.save()
        p2 = UserProfile(u2)
        p2.save()

        article = Article(p1, "title", "some body", description="some")
        article.save()
        assert article.favourite(p1)
        assert article.unfavourite(p1)
        assert not article.is_favourite(p1)