From 3430c94029ca50e7910e94fb908062289d965449 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Sun, 4 Nov 2012 01:31:04 -0200 Subject: [PATCH] Update the 'At last! An FT for a normal page' section output My output was: $ ./manage.py test fts Creating test database for alias 'default'... .E ====================================================================== ERROR: test_voting_on_a_new_poll (fts.tests.PollsTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/adorilson/workspace/tddjangotutorial/fts/tests.py", line 165, in test_voting_on_a_new_poll heading = self.browser.find_element_by_tag_name('h1') File "/home/adorilson/.virtualenvs/dj1.4/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 309, in find_element_by_tag_name return self.find_element(by=By.TAG_NAME, value=name) File "/home/adorilson/.virtualenvs/dj1.4/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 671, in find_element {'using': by, 'value': value})['value'] File "/home/adorilson/.virtualenvs/dj1.4/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 156, in execute self.error_handler.check_response(response) File "/home/adorilson/.virtualenvs/dj1.4/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 147, in check_response raise exception_class(message, screen, stacktrace) NoSuchElementException: Message: u'Unable to locate element: {"method":"tag name","selector":"h1"}' ---------------------------------------------------------------------- Ran 2 tests in 34.518s FAILED (errors=1) Destroying test database for alias 'default'... --- tutorial03.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorial03.rst b/tutorial03.rst index 2ecfcb9..f96b485 100644 --- a/tutorial03.rst +++ b/tutorial03.rst @@ -51,7 +51,7 @@ Create a new test method inside ``fts/tests.py``. # He clicks 'submit' # The page refreshes, and he sees that his choice - # has updated the results. they now say + # has updated the results. They now say # "100 %: very awesome". # The page also says "1 votes" @@ -242,7 +242,7 @@ we look for the default 'no votes yet' message on the next page. Let's run that, and see where we get:: - AssertionError: u'Page not found (404)' != 'PollsNoSuchElementException: Message: u'Unable to locate element: {"method":"tag name","selector":"h1"}' + NoSuchElementException: Message: u'Unable to locate element: {"method":"tag name","selector":"h1"}' URLS and view functions, and the Django Test Client