Ejemplo n.º 1
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
Ejemplo n.º 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
Ejemplo n.º 3
0
def test_new_post_updates():
    #creating a new post updates lense
    #feed and author feed
    lense = test_create_lense()
    assert len(lense.feed.entries) == 0
    assert len(lense.author.feed.entries) == 0
    post = Post('test this shit out',
                prefix='/sean/public/%s/posts' % lense.name,
                author=lense.author,
                lense=lense)
    post.save(db=db)
    lense.update()
    assert len(lense.feed.entries) == 1
    assert len(lense.author.feed.entries) == 1
    post.delete()
    lense.update()
    assert len(lense.feed.entries) == 0
    assert len(lense.author.feed.entries) == 0
Ejemplo n.º 4
0
def test_new_post_updates():
    #creating a new post updates lense
    #feed and author feed
    lense = test_create_lense()
    assert len(lense.feed.entries) == 0
    assert len(lense.author.feed.entries) == 0
    post = Post('test this shit out',
                prefix='/sean/public/%s/posts' % lense.name,
                author=lense.author,
                lense=lense)
    post.save(db=db)
    lense.update()
    assert len(lense.feed.entries) == 1
    assert len(lense.author.feed.entries) == 1
    post.delete()
    lense.update()
    assert len(lense.feed.entries) == 0
    assert len(lense.author.feed.entries) == 0