|
|
@@ -1,9 +1,10 @@
|
|
|
+from django.test import LiveServerTestCase
|
|
|
from selenium import webdriver
|
|
|
from selenium.webdriver.common.keys import Keys
|
|
|
import time
|
|
|
import unittest
|
|
|
|
|
|
-class NewVisitorTest(unittest.TestCase):
|
|
|
+class NewVisitorTest(LiveServerTestCase):
|
|
|
|
|
|
def setUp(self):
|
|
|
self.browser = webdriver.Firefox()
|
|
|
@@ -19,7 +20,7 @@ class NewVisitorTest(unittest.TestCase):
|
|
|
def test_can_start_a_list_and_retrieve_it_later(self):
|
|
|
# Edith has heard about a cool new online to-do app. She goes
|
|
|
# to check out its homepage
|
|
|
- self.browser.get('http://localhost:8000')
|
|
|
+ self.browser.get(self.live_server_url)
|
|
|
|
|
|
# She notices the page title and header mention to-do lists
|
|
|
self.assertIn('MovieLib', self.browser.title)
|
|
|
@@ -54,6 +55,3 @@ class NewVisitorTest(unittest.TestCase):
|
|
|
# enters "Armageddon"
|
|
|
# self.fail('Finish the test!')
|
|
|
# She is invited to enter a to-do item straight away
|
|
|
-
|
|
|
-if __name__ == '__main__':
|
|
|
- unittest.main(warnings='ignore')
|