File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 12
12
13
13
from http import HTTPStatus
14
14
15
- from ...common .db .packaging import ProjectFactory , ReleaseFactory
15
+ from ...common .db .packaging import FileFactory , ProjectFactory , ReleaseFactory
16
16
17
17
18
18
def test_simple_api_html (webtest ):
@@ -24,10 +24,13 @@ def test_simple_api_html(webtest):
24
24
25
25
def test_simple_api_detail (webtest ):
26
26
project = ProjectFactory .create ()
27
- ReleaseFactory .create_batch (2 , project = project )
27
+ release = ReleaseFactory .create (project = project )
28
+ FileFactory .create_batch (2 , release = release , packagetype = "bdist_wheel" )
28
29
29
30
resp = webtest .get (f"/simple/{ project .normalized_name } /" , status = HTTPStatus .OK )
30
31
31
32
assert resp .content_type == "text/html"
32
33
assert "X-PyPI-Last-Serial" in resp .headers
33
- assert f"Links for { project .normalized_name } " in resp .text
34
+ assert resp .html .h1 .string == f"Links for { project .normalized_name } "
35
+ # There should be a link for every file
36
+ assert len (resp .html .find_all ("a" )) == 2
You can’t perform that action at this time.
0 commit comments