def test_delete_post(): tearDown() author = create_author(db) l = Lense(name = 'facebook', subdomain=SUBDOMAIN, db=db, author=author).save() assert len(l.feed.entries) == 0 assert len(author.feed.entries) == 0 post = Post(content='test this out', title='super awesome title', author = author, prefix=l.feed.url, db=db, lense=l).save() l.update() author.update() assert len(l.feed.entries) == 1 assert len(author.feed.entries) == 1 post.delete() l.update() author.update() assert len(l.feed.entries) == 0 assert len(author.feed.entries) == 0
def test_delete_post(): tearDown() author = create_author(db) l = Lense(name='facebook', subdomain=SUBDOMAIN, db=db, author=author).save() assert len(l.feed.entries) == 0 assert len(author.feed.entries) == 0 post = Post(content='test this out', title='super awesome title', author=author, prefix=l.feed.url, db=db, lense=l).save() l.update() author.update() assert len(l.feed.entries) == 1 assert len(author.feed.entries) == 1 post.delete() l.update() author.update() assert len(l.feed.entries) == 0 assert len(author.feed.entries) == 0
def test_delete_author(): author = create_author(db) af = author.feed l = Lense(name='facebook', subdomain=SUBDOMAIN, db=db, author=author).save() post = Post(content='test this out', title='super awesome title', author=author, prefix=l.feed.url, db=db, lense=l).save() l.update() author.update() assert len(l.feed.entries) == 1 assert len(author.feed.entries) == 1 author.delete() assert_raises(Exception, db.get, author.url) assert_raises(Exception, db.get, l.url) assert_raises(Exception, db.get, post.url) assert_raises(Exception, db.get, af.url)
def test_delete_author(): author = create_author(db) af = author.feed l = Lense(name = 'facebook', subdomain=SUBDOMAIN, db=db, author=author).save() post = Post(content='test this out', title='super awesome title', author = author, prefix=l.feed.url, db=db, lense=l).save() l.update() author.update() assert len(l.feed.entries) == 1 assert len(author.feed.entries) == 1 author.delete() assert_raises(Exception, db.get, author.url) assert_raises(Exception, db.get, l.url) assert_raises(Exception, db.get, post.url) assert_raises(Exception, db.get, af.url)