blob: 39a43635b952cdafb3c6ccd7d5a2b7d376053979 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
From: Dmitry Shachnev <mitya57@debian.org>
Date: Mon, 31 Jul 2023 15:22:24 +0300
Subject: Make the tests pass with Sphinx 7.1
Forwarded: https://github.com/sphinx-contrib/jquery/pull/26
---
tests/test_jquery_installed.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/tests/test_jquery_installed.py b/tests/test_jquery_installed.py
index a402bd4..08c25ba 100644
--- a/tests/test_jquery_installed.py
+++ b/tests/test_jquery_installed.py
@@ -38,12 +38,14 @@ def test_jquery_installed_sphinx_ge_60_use_sri(blank_app):
out_dir = blank_app(confoverrides={"extensions": ["sphinxcontrib.jquery"], "jquery_use_sri": True})
text = out_dir.joinpath("index.html").read_text(encoding="utf-8")
+ checksum = '?v=5d32c60e' if sphinx.version_info[:2] >= (7, 1) else ''
assert ('<script '
'integrity="sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK" '
- 'src="_static/jquery.js"></script>') in text
+ f'src="_static/jquery.js{checksum}"></script>') in text
+ checksum = '?v=2cd50e6c' if sphinx.version_info[:2] >= (7, 1) else ''
assert ('<script '
'integrity="sha384-lSZeSIVKp9myfKbDQ3GkN/KHjUc+mzg17VKDN4Y2kUeBSJioB9QSM639vM9fuY//" '
- 'src="_static/_sphinx_javascript_frameworks_compat.js"></script>') in text
+ f'src="_static/_sphinx_javascript_frameworks_compat.js{checksum}"></script>') in text
static_dir = out_dir / '_static'
assert static_dir.joinpath('jquery.js').is_file()
@@ -56,10 +58,12 @@ def test_jquery_installed_sphinx_ge_60(blank_app):
out_dir = blank_app(confoverrides={"extensions": ["sphinxcontrib.jquery"]})
text = out_dir.joinpath("index.html").read_text(encoding="utf-8")
+ checksum = '?v=5d32c60e' if sphinx.version_info[:2] >= (7, 1) else ''
assert ('<script '
- 'src="_static/jquery.js"></script>') in text
+ f'src="_static/jquery.js{checksum}"></script>') in text
+ checksum = '?v=2cd50e6c' if sphinx.version_info[:2] >= (7, 1) else ''
assert ('<script '
- 'src="_static/_sphinx_javascript_frameworks_compat.js"></script>') in text
+ f'src="_static/_sphinx_javascript_frameworks_compat.js{checksum}"></script>') in text
static_dir = out_dir / '_static'
assert static_dir.joinpath('jquery.js').is_file()
|