Explorar o código

Move FT to own dir and use LiveServerTestCase

Benoît Hubert %!s(int64=7) %!d(string=hai) anos
pai
achega
722806a1e5
Modificáronse 2 ficheiros con 3 adicións e 5 borrados
  1. 0 0
      functional_tests/__init__.py
  2. 3 5
      functional_tests.py

+ 0 - 0
functional_tests/__init__.py


+ 3 - 5
functional_tests.py

@@ -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')