def then_i_see_the_post_in_the_editing_form(step): title = css("#id_title").get_attribute("value").strip() assert title == "My Title Draft", "wrong title: '%s'" % title body = css("#id_body").text.strip() assert body == "This is the body of my Draft post", "wrong body: '%s'" % body
def then_the_post_appears_on_my_blog(step): world.browser.get(django_url("/blogs/")) csss("a.read-more")[0].click() assert css("h2").text.strip() == "My Title Publish"
def given_i_click_on_the_first_one(step): css("a.edit-post").click()
def and_i_visit_the_post_editor(step): world.browser.get(django_url("/posts/edit")) css(".edit-post")
def given_i_create_a_post_with_status(step, status): css("#id_title").send_keys("My Title %s" % status) css("#id_body").send_keys("This is the body of my %s post" % status) css(".tagit-input").send_keys("tag1, tag2, tag3") css("#id_status").send_keys(status) css("input[type=submit]").click()