From 82cfa4ef7187fc13b34e55d895fe9b9cbcd3edf5 Mon Sep 17 00:00:00 2001 From: Gagan Deep Date: Fri, 27 Mar 2026 21:52:44 +0530 Subject: [PATCH] [fix] Fixed the test script to execute all tests --- tests/runtests.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/runtests.py b/tests/runtests.py index df9c964f..a5a92de6 100644 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -227,9 +227,11 @@ def test_create_prefix_users(self): prefix_pdf_file_path = self.base_driver.find_element( By.XPATH, '//a[text()="Download User Credentials"]' ).get_property("href") - reqHeader = { - "Cookie": f"sessionid={self.base_driver.get_cookies()[0]['value']}" - } + reqHeader = {} + for cookies in self.base_driver.get_cookies(): + if cookies["name"] == "sessionid": + reqHeader = {"Cookie": f"sessionid={cookies['value']}"} + break curlRequest = request.Request(prefix_pdf_file_path, headers=reqHeader) try: if request.urlopen(curlRequest, context=self.ctx).getcode() != 200: @@ -362,9 +364,7 @@ def test_celery(self): "openwisp_firmware_upgrader.tasks.create_all_device_firmwares", "openwisp_firmware_upgrader.tasks.create_device_firmware", "openwisp_firmware_upgrader.tasks.upgrade_firmware", - "openwisp_monitoring.check.tasks.auto_create_config_check", - "openwisp_monitoring.check.tasks.auto_create_iperf3_check", - "openwisp_monitoring.check.tasks.auto_create_ping", + "openwisp_monitoring.check.tasks.auto_create_check", "openwisp_monitoring.check.tasks.perform_check", "openwisp_monitoring.check.tasks.run_checks", "openwisp_monitoring.device.tasks.delete_wifi_clients_and_sessions", @@ -385,7 +385,6 @@ def test_celery(self): "openwisp_notifications.tasks.ns_organization_user_deleted", "openwisp_notifications.tasks.ns_register_unregister_notification_type", "openwisp_notifications.tasks.update_org_user_notificationsetting", - "openwisp_notifications.tasks.update_superuser_notification_settings", "openwisp_radius.tasks.cleanup_stale_radacct", "openwisp_radius.tasks.convert_called_station_id", "openwisp_radius.tasks.deactivate_expired_users", @@ -490,7 +489,4 @@ def test_containers_down(self): if __name__ == "__main__": - suite = unittest.TestSuite() - suite.addTest(TestServices("test_topology_graph")) - runner = unittest.TextTestRunner(verbosity=2) - runner.run(suite) + unittest.main(verbosity=2)