From 8b3d82fff55c32a698d5d8e6ee71e3f643c58c73 Mon Sep 17 00:00:00 2001 From: Disco DeDisco Date: Thu, 1 Jan 2026 15:50:40 -0500 Subject: [PATCH] functional_tests.py -> functional_tests/tests.py; also initiated as django folder w. __init__.py, __pycache__/ --- functional_tests/__init__.py | 0 functional_tests.py => functional_tests/tests.py | 8 +++----- 2 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 functional_tests/__init__.py rename functional_tests.py => functional_tests/tests.py (91%) diff --git a/functional_tests/__init__.py b/functional_tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/functional_tests.py b/functional_tests/tests.py similarity index 91% rename from functional_tests.py rename to functional_tests/tests.py index 753d95d..ad40225 100644 --- a/functional_tests.py +++ b/functional_tests/tests.py @@ -1,10 +1,11 @@ +from django.test import LiveServerTestCase from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys import time import unittest -class NewVisitorTest(unittest.TestCase): +class NewVisitorTest(LiveServerTestCase): # Helper methods def setUp(self): self.browser = webdriver.Firefox() @@ -19,7 +20,7 @@ class NewVisitorTest(unittest.TestCase): # Test methods 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) header_text = self.browser.find_element(By.TAG_NAME, 'h1').text @@ -40,6 +41,3 @@ class NewVisitorTest(unittest.TestCase): 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('1: Buy peacock feathers') - -if __name__ == "__main__": - unittest.main() \ No newline at end of file