1
Fork 0

Rename method for future expansion

This commit is contained in:
Jake Howard 2018-08-02 13:59:59 +01:00
parent eb2215cd47
commit 33fea2254c
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -40,7 +40,7 @@ class BaseTestCase(WagtailPageTests):
def parse_content(self, content): def parse_content(self, content):
return BeautifulSoup(content, 'html.parser') return BeautifulSoup(content, 'html.parser')
def get_page_title(self, response): def get_html_title(self, response):
return self.parse_content(response.content).title.string return self.parse_content(response.content).title.string
def create_initial_homepage(self): def create_initial_homepage(self):
@ -93,7 +93,7 @@ class PageTestCase(BaseTestCase):
def test_page_title(self): def test_page_title(self):
response = self.client.get(self.page.url) response = self.client.get(self.page.url)
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
title = self.get_page_title(response) title = self.get_html_title(response)
self.assertEqual(self.page.get_page_title(), title) self.assertEqual(self.page.get_page_title(), title)
self.assertEqual(self.page.get_page_title(), "Test :: {}".format(settings.WAGTAIL_SITE_NAME)) self.assertEqual(self.page.get_page_title(), "Test :: {}".format(settings.WAGTAIL_SITE_NAME))
@ -105,6 +105,6 @@ class PageTestCase(BaseTestCase):
new_page = HomePage.objects.get(title='Test Child') new_page = HomePage.objects.get(title='Test Child')
response = self.client.get(new_page.url) response = self.client.get(new_page.url)
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
title = self.get_page_title(response) title = self.get_html_title(response)
self.assertEqual(new_page.get_page_title(), title) self.assertEqual(new_page.get_page_title(), title)
self.assertEqual(new_page.get_page_title(), "Test Child :: Test :: {}".format(settings.WAGTAIL_SITE_NAME)) self.assertEqual(new_page.get_page_title(), "Test Child :: Test :: {}".format(settings.WAGTAIL_SITE_NAME))