10000 Sites - Pass Site obj instead of pk when creating a StaticPlaceholder by michauds · Pull Request #6679 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

Sites - Pass Site obj instead of pk when creating a StaticPlaceholder #6679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 8, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Moved test to it's own class
  • Loading branch information
michauds committed Jun 1, 2019
commit fe3ce77d387331d7572d0fbac7cc41f4234e9d6a
14 changes: 11 additions & 3 deletions cms/tests/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,19 @@ def test_site_publish(self):
response = self.client.get(page_url)
self.assertEqual(response.status_code, 200)

def test_create_site_specific_placeholder(self):

class TestSiteBoundStaticPlaceholder(SiteTestCase):
def setUp(self):
super(TestSiteBoundStaticPlaceholder, self).setUp()
with self.settings(
CMS_TEMPLATES=(('placeholder_tests/static_with_site.html', 'tpl'), ),
):
page = create_page('page', 'placeholder_tests/static_with_site.html', language='de')
self.test_page = create_page('page', 'placeholder_tests/static_with_site.html', language='de')

response = self.client.get(page.get_absolute_url(language='de') + u'?structure')
def tearDown(self):
self.test_page.delete()
super(TestSiteBoundStaticPlaceholder, self).tearDown()

def test_create_site_specific_placeholder(self):
response = self.client.get(self.test_page.get_absolute_url(language='de') + '?structure')
self.assertEqual(response.status_code, 200)
0