コード例 #1
0
ファイル: post_model_tests.py プロジェクト: palimadra/dustbin
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
コード例 #2
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
コード例 #3
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)
コード例 #4
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)