tests: improve determinism of some asserts (#70933)

This commit is contained in:
Benjamin Dauvergne 2022-11-12 10:51:30 +01:00
parent 6bea11793f
commit 0f80485968
2 changed files with 7 additions and 4 deletions

View File

@ -306,8 +306,9 @@ def test_create_application(app, admin_user, settings, analyze):
assert version.pk != same_version.pk
resp = app.get('/applications/manifest/test/versions/')
assert resp.text.count('1.0') == 1
assert resp.text.count('2.0') == 1
versions = [e.text() for e in resp.pyquery('h3').items()]
assert versions.count('1.0') == 1
assert versions.count('2.0') == 1
assert resp.text.count('Creating application bundle') == 3
resp = resp.click(href='/applications/manifest/test/download/%s/' % same_version.pk)
assert resp.content_type == 'application/x-tar'
@ -327,8 +328,9 @@ def test_create_application(app, admin_user, settings, analyze):
assert new_version.notes == 'Foo bar blah. But with an icon.'
assert new_version.pk != version.pk # new version created
resp = app.get('/applications/manifest/test/versions/')
assert resp.text.count('1.0') == 2
assert resp.text.count('2.0') == 1
versions = [e.text() for e in resp.pyquery('h3').items()]
assert versions.count('1.0') == 2
assert versions.count('2.0') == 1
assert resp.text.count('Creating application bundle') == 4
# non editable app

View File

@ -45,6 +45,7 @@ deps:
coverage
cssselect
WebTest
pyquery
django-mellon
django-webtest
Markdown<3