tests: fix misc test failures (#67724)

This commit is contained in:
Agate 2022-07-27 16:10:38 +02:00 committed by Frédéric Péters
parent f95a39744d
commit 47a1a1314f
3 changed files with 6 additions and 7 deletions

View File

@ -26,7 +26,6 @@ from combo.data.models import (
ConfigJsonCell,
FeedCell,
JsonCell,
JsonCellBase,
LinkCell,
LinkListCell,
MenuCell,
@ -76,13 +75,13 @@ def test_media():
class Meta:
# to prevent error in Models metaclass as the current module is not
# in a registered applicatoin
proxy = True
app_label = 'data'
abstract = True
cells = [TextCelleWithMedia() for i in range(3)]
assert (
force_text(sum((cell.media for cell in cells), Media()))
== '<script type="text/javascript" src="/static/coincoin.js"></script>'
== '<script src="/static/coincoin.js"></script>'
)
@ -1243,7 +1242,7 @@ def test_config_json_cell_validity(settings, context):
def test_json_force_async():
cell = JsonCellBase()
cell = JsonCell()
cell.url = 'http://example.net/test-force-async'
cell.template_string = '{{json.hello}}'
cell.force_async = True
@ -1261,7 +1260,7 @@ def test_json_force_async():
cell.force_async = False
assert cell.render({}) == 'world'
cell = JsonCellBase()
cell = JsonCell()
cell.url = 'http://example.net/test-force-async-2'
cell.template_string = '{{json.hello}}'
cell.force_async = False

View File

@ -602,7 +602,7 @@ def test_404(app):
with override_settings(DEBUG=True):
# check error page provides an hint when debugging
resp = app.get('/foobar/', status=404)
assert "can&#39;t find the requested page" in resp.text
assert "can&#x27;t find the requested page" in resp.text
# check native django handler is used if all pages are private
page.public = False

View File

@ -1432,7 +1432,7 @@ def test_index_site_num_queries(settings, app):
assert IndexedCell.objects.count() == 50
with CaptureQueriesContext(connection) as ctx:
index_site()
assert len(ctx.captured_queries) == 225
assert len(ctx.captured_queries) == 175
SearchCell.objects.create(
page=page, placeholder='content', order=0, _search_services={'data': ['search1']}