Skip to content

Replace constant string by POLL1.choices #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions tutorial04.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ Let's start by extending our FT, to show Herbert voting on a poll. In
# The buttons have labels to explain them
choice_labels = self.browser.find_elements_by_tag_name('label')
choices_text = [c.text for c in choice_labels]
self.assertEquals(choices_text, [
'Very awesome',
'Quite awesome',
'Moderately awesome',
])
self.assertEquals(choices_text, POLL1.choices)
# He decided to select "very awesome", which is answer #1
chosen = self.browser.find_element_by_css_selector(
"input[value='1']"
Expand Down Expand Up @@ -632,13 +628,8 @@ do any harm, for now maybe it's easiest to just change the FT:
# The buttons have labels to explain them
choice_labels = choice_inputs = self.browser.find_elements_by_tag_name('label')
choices_text = [c.text for c in choice_labels]
self.assertEquals(choices_text, [
'Vote:', # this label is auto-generated for the whole form
'Very awesome',
'Quite awesome',
'Moderately awesome',
])

# this 'Vote:' label is auto-generated for the whole form
self.assertEquals(choices_text, ['Vote:'] + POLL1.choices)

The FT should now get a little further::

Expand Down