summaryrefslogtreecommitdiffstats
path: root/tests/test_pages.py
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2017-11-09 11:50:37 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2017-11-09 13:51:23 (GMT)
commit9549c472a657de733c4007ef475b4d8318aa95a5 (patch)
tree9ac7f35d3bb3faf4a40b88dd81c562660f2daec1 /tests/test_pages.py
parent1fff18760f2cbfe0cfc2df68498258674d0cb774 (diff)
downloadcombo-9549c472a657de733c4007ef475b4d8318aa95a5.zip
combo-9549c472a657de733c4007ef475b4d8318aa95a5.tar.gz
combo-9549c472a657de733c4007ef475b4d8318aa95a5.tar.bz2
misc: use real hostname in fake request used to get placeholders (#19993)v1.10
Diffstat (limited to 'tests/test_pages.py')
-rw-r--r--tests/test_pages.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_pages.py b/tests/test_pages.py
index 94398e2..669d96e 100644
--- a/tests/test_pages.py
+++ b/tests/test_pages.py
@@ -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 combo.data.models import Page, CellBase, TextCell, LinkCell
from combo.data.management.commands.import_site 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