django - TDD with Python chapter 1 no output from functional_tests.py -
i following book tdd python. in chapter 1 there piece of code
from selenium import webdriver import unittest class newvisitortest(unittest.testcase): def setup(self): self.browser = webdriver.firefox() self.browser.implicitly_wait(5) def teardown(self): self.browser.quit() def test_can_start_a_list_and_retrieve_it_later(self): self.browser.get('http://localhost:8000') self.assertin('to-do', self.browser.title) self.fail('finish test!') if __name__ == '__main__': unittest.main(warnings='ignore')
the file called functional_tests.py. have django 1.7 , selenium installed globally on ubuntu 14.04. started fresh project superlists. run server before try tests. when run test with
python3 functional_tests.py
firefox window opens , loads default django startup page , window stays open though should close after test runs. there no output tests @ all. expecting this:
f ====================================================================== fail: test_can_start_a_list_and_retrieve_it_later (__main__.newvisitortest) --------------------------------------------------------------------- traceback (most recent call last): file "functional_tests.py", line 18, in test_can_start_a_list_and_retrieve_it_later self.assertin('to-do', self.browser.title) assertionerror: 'to-do' not found in 'welcome django' --------------------------------------------------------------------- ran 1 test in 1.747s failed (failures=1)
what problem? thanks
have installed recent version of selenium? mentioned in book, should have matching version of firefox , selenium.
Comments
Post a Comment