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="******" )
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"] )
def Replacing_a_poem_not_logged_in_is_an_error(): db = FakeDb() poemtube.replacepoem( db, "id1", title="X", author="X", text="X", user=None )
def Replacing_a_poem_contributed_by_someone_else_is_an_error(): db = FakeDb() poemtube.replacepoem( db, "id1", title="X", author="X", text="X", user="******" )
def my_replacepoem(db, id, title, author, text, user): replacepoem(db, id=id, title=title, author=author, text=text, user=user) return ""
def my_replacepoem( db, id, title, author, text, user ): replacepoem( db, id=id, title=title, author=author, text=text, user=user ) return ""