path: root/tests/
diff options
authorFrédéric Péters <>2017-11-09 11:50:37 (GMT)
committerFrédéric Péters <>2017-11-09 13:51:23 (GMT)
commit9549c472a657de733c4007ef475b4d8318aa95a5 (patch)
tree9ac7f35d3bb3faf4a40b88dd81c562660f2daec1 /tests/
parent1fff18760f2cbfe0cfc2df68498258674d0cb774 (diff)
misc: use real hostname in fake request used to get placeholders (#19993)v1.10
Diffstat (limited to 'tests/')
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/ b/tests/
index 94398e2..669d96e 100644
--- a/tests/
+++ b/tests/
@@ -7,6 +7,7 @@ import sys
from django.conf import settings
from django.contrib.auth.models import User, Group
from django.test import override_settings
+from django.test.client import RequestFactory
from django.utils.timezone import now
from import Page, CellBase, TextCell, LinkCell
from import Command as ImportSiteCommand
@@ -266,7 +267,8 @@ def test_last_update_time():
def test_get_placeholders():
page = Page(title=u'foo', slug='foo', template_name='standard-sidebar', order=0)
- placeholders = page.get_placeholders()
+ request = RequestFactory().get('/')
+ placeholders = page.get_placeholders(request=request)
assert [x.key for x in placeholders] == ['content', 'sidebar', 'footer']
assert placeholders[0].acquired is False
assert placeholders[-1].acquired is True
@@ -281,7 +283,7 @@ def test_get_placeholders():
'sidebar': {'name': 'Sidebar'},
'footer': {'name': 'Footer', 'acquired': False},
- placeholders = page.get_placeholders()
+ placeholders = page.get_placeholders(request=request)
assert set([x.key for x in placeholders]) == set(['content', 'content2', 'sidebar', 'footer'])
footer_placeholder = [x for x in placeholders if x.key == 'footer'][0]
assert footer_placeholder.acquired is False