From d51067191e1c65efac0f951e762ab30555bfb386 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 08:42:31 +0000 Subject: [PATCH 1/4] Bump flask from 2.3.3 to 3.0.0 Bumps [flask](https://github.com/pallets/flask) from 2.3.3 to 3.0.0. - [Release notes](https://github.com/pallets/flask/releases) - [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/flask/compare/2.3.3...3.0.0) --- updated-dependencies: - dependency-name: flask dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements/test.txt | 2 +- requirements/test_windows.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/test.txt b/requirements/test.txt index 01abf80c2..68277b8db 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,4 +1,4 @@ -Flask==2.3.3 +Flask==3.0.0 werkzeug==2.3.7 coverage==7.3.1 argparse diff --git a/requirements/test_windows.txt b/requirements/test_windows.txt index 2815d4de3..e1616d52b 100644 --- a/requirements/test_windows.txt +++ b/requirements/test_windows.txt @@ -1,4 +1,4 @@ -Flask==2.3.3 +Flask==3.0.0 coverage==7.3.1 argparse pytest==7.4.2 From 81cebf1e5659d985864eb09be074841f133a68b0 Mon Sep 17 00:00:00 2001 From: francisco souza <108725+fsouza@users.noreply.github.com> Date: Tue, 3 Oct 2023 00:17:15 -0400 Subject: [PATCH 2/4] requirements/test: bump werkzeug too --- requirements/test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/test.txt b/requirements/test.txt index 68277b8db..e5ffadc7e 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,5 +1,5 @@ Flask==3.0.0 -werkzeug==2.3.7 +werkzeug==3.0.0 coverage==7.3.1 argparse Django>=2.0.6 From 44d078a6398c038076465cb3f77f651511c9113e Mon Sep 17 00:00:00 2001 From: francisco souza <108725+fsouza@users.noreply.github.com> Date: Tue, 3 Oct 2023 00:22:51 -0400 Subject: [PATCH 3/4] requirements/test: remove werkzeug Let pip resolve it from Flask. --- requirements/test.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements/test.txt b/requirements/test.txt index e5ffadc7e..76e72a7ac 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,5 +1,4 @@ Flask==3.0.0 -werkzeug==3.0.0 coverage==7.3.1 argparse Django>=2.0.6 From b2ce382d84924ff5716bcc210aa9cf58c216707c Mon Sep 17 00:00:00 2001 From: francisco souza <108725+fsouza@users.noreply.github.com> Date: Tue, 3 Oct 2023 00:31:18 -0400 Subject: [PATCH 4/4] Fix compatibility with Werkzeug 3.0 --- splinter/driver/flaskclient.py | 6 +++--- tests/test_flaskclient.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/splinter/driver/flaskclient.py b/splinter/driver/flaskclient.py index 390a46a8e..0eb988f8f 100644 --- a/splinter/driver/flaskclient.py +++ b/splinter/driver/flaskclient.py @@ -36,7 +36,7 @@ def delete_all(self): def all(self, verbose=False): # NOQA: A003 cookies = {} - for cookie in self.driver.cookie_jar: + for cookie in self.driver._cookies.values(): cookies[cookie.key] = cookie.value return cookies @@ -44,14 +44,14 @@ def __getitem__(self, item): return self.driver.get_cookie(item).value def __contains__(self, key): - for cookie in self.driver.cookie_jar: + for cookie in self.driver._cookies.values(): if cookie.key == key: return True return False def __eq__(self, other_object): if isinstance(other_object, dict): - cookies_dict = {c.key: c.value for c in self.driver.cookie_jar} + cookies_dict = {c.key: c.value for c in self.driver._cookies.values()} return cookies_dict == other_object return False diff --git a/tests/test_flaskclient.py b/tests/test_flaskclient.py index b58dec675..c8996f33c 100644 --- a/tests/test_flaskclient.py +++ b/tests/test_flaskclient.py @@ -171,7 +171,7 @@ def test_cookies_extra_parameters(self): """Cookie can be created with extra parameters.""" timestamp = int(time.time() + 120) self.browser.cookies.add({"sha": "zam"}, expires=timestamp) - cookie = {c.key: c for c in self.browser._browser.cookie_jar}["sha"] + cookie = {c.key: c for c in self.browser._browser._cookies.values()}["sha"] assert timestamp == int(cookie.expires.timestamp())