Beispiel #1
0
def Replacing_a_nonexistent_poem_is_an_error__test():
    db = FakeDb()
    poemtube.replacepoem(
        db,
        "nonexistid",
        title="title X",
        author="author X",
        text="text X",
        user="******"
    )
Beispiel #2
0
def Can_replace_an_existing_poem__test():
    db = FakeDb()
    poemtube.replacepoem(
        db,
        "id1",
        title="title X",
        author="author X",
        text="text X",
        user="******"
    )

    modentry = db.poems.data["id1"]

    assert_equal( "title X",  modentry["title"] )
    assert_equal( "author X", modentry["author"] )
    assert_equal( "text X",   modentry["text"] )
    assert_equal( "user1",    modentry["contributor"] )
Beispiel #3
0
def Replacing_a_poem_not_logged_in_is_an_error():
    db = FakeDb()
    poemtube.replacepoem(
        db, "id1", title="X", author="X", text="X", user=None )
Beispiel #4
0
def Replacing_a_poem_contributed_by_someone_else_is_an_error():
    db = FakeDb()
    poemtube.replacepoem(
        db, "id1", title="X", author="X", text="X", user="******" )
Beispiel #5
0
def my_replacepoem(db, id, title, author, text, user):
    replacepoem(db, id=id, title=title, author=author, text=text, user=user)
    return ""
Beispiel #6
0
def my_replacepoem( db, id, title, author, text, user ):
    replacepoem( db, id=id, title=title, author=author, text=text, user=user )
    return ""