functional_tests.py -> functional_tests/tests.py; also initiated as django folder w. __init__.py, __pycache__/

This commit is contained in:
Disco DeDisco
2026-01-01 15:50:40 -05:00
parent 2615445b97
commit 8b3d82fff5
2 changed files with 3 additions and 5 deletions

View File

View File

@@ -1,10 +1,11 @@
from django.test import LiveServerTestCase
from selenium import webdriver from selenium import webdriver
from selenium.webdriver.common.by import By from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.keys import Keys
import time import time
import unittest import unittest
class NewVisitorTest(unittest.TestCase): class NewVisitorTest(LiveServerTestCase):
# Helper methods # Helper methods
def setUp(self): def setUp(self):
self.browser = webdriver.Firefox() self.browser = webdriver.Firefox()
@@ -19,7 +20,7 @@ class NewVisitorTest(unittest.TestCase):
# Test methods # Test methods
def test_can_start_a_todo_list(self): def test_can_start_a_todo_list(self):
self.browser.get("http://localhost:8000") self.browser.get(self.live_server_url)
self.assertIn("To-Do", self.browser.title) self.assertIn("To-Do", self.browser.title)
header_text = self.browser.find_element(By.TAG_NAME, 'h1').text header_text = self.browser.find_element(By.TAG_NAME, 'h1').text
@@ -40,6 +41,3 @@ class NewVisitorTest(unittest.TestCase):
time.sleep(1) time.sleep(1)
self.check_for_row_in_list_table('2: Use peacock feathers to make a fly') self.check_for_row_in_list_table('2: Use peacock feathers to make a fly')
self.check_for_row_in_list_table('1: Buy peacock feathers') self.check_for_row_in_list_table('1: Buy peacock feathers')
if __name__ == "__main__":
unittest.main()