Permalink
Browse files

some renames, going over tute 3...

  • Loading branch information...
1 parent ea5ae08 commit 710847e5635513800b9a6e7981cd2580186f19d6 @hjwp committed Dec 10, 2011
View
@@ -31,7 +31,6 @@ def _setup_polls_via_admin(self):
password_field.send_keys(Keys.RETURN)
# She has a number of polls to enter. For each one, she:
-
for poll_info in [POLL1, POLL2]:
# Follows the link to the Polls app, and adds a new Poll
self.browser.find_elements_by_link_text('Polls')[1].click()
@@ -73,8 +72,6 @@ def test_voting_on_a_new_poll(self):
# creates a couple of new Polls, and their response choices
self._setup_polls_via_admin()
- self.fail('TODO')
-
# Now, Herbert the regular user goes to the homepage of the site. He
# sees a list of polls.
self.browser.get(ROOT)
View
@@ -81,7 +81,7 @@ def test_choice_defaults(self):
-class TestAllPollsView(TestCase):
+class TestHomePageView(TestCase):
def test_root_url_shows_links_to_all_polls(self):
# set up some polls
@@ -93,8 +93,9 @@ def test_root_url_shows_links_to_all_polls(self):
client = Client()
response = client.get('/')
+ # check we've used the "home.html" template
template_names_used = [t.name for t in response.templates]
- self.assertIn('polls.html', template_names_used)
+ self.assertIn('home.html', template_names_used)
# check we've passed the polls to the template
polls_in_context = response.context['polls']
@@ -152,6 +153,7 @@ def test_page_shows_poll_title_and_no_votes_message(self):
self.assertIn(choice4.choice, response.content.replace(''', "'"))
+
class TestPollsVoteForm(TestCase):
def test_form_renders_poll_choices_as_radio_inputs(self):
View
@@ -1,11 +1,10 @@
from django.shortcuts import render
-from django.http import HttpResponse
from polls.models import Poll
from polls.forms import PollVoteForm
def polls(request):
context = {'polls': Poll.objects.all()}
- return render(request, 'polls.html', context)
+ return render(request, 'home.html', context)
def poll(request, poll_id):
poll = Poll.objects.get(pk=poll_id)
Oops, something went wrong.

0 comments on commit 710847e

Please sign in to comment.