'Test that a page can edited via the admin'

def test_edit_page(self):

    superuser = self.get_superuser()
    with self.login_user_context(superuser):
        page_data = self.get_new_page_data()
        response = self.client.post(URL_CMS_PAGE_ADD, page_data)
        page = Page.objects.get(title_set__slug=page_data['slug'], publisher_is_draft=True)
        response = self.client.get((URL_CMS_PAGE_CHANGE % page.id))
        self.assertEqual(response.status_code, 200)
        self.assertContains(response, '<title>Change    a    page</title>', html=True)
        page_data['title'] = 'changed    title'
        response = self.client.post((URL_CMS_PAGE_CHANGE % page.id), page_data)
        self.assertRedirects(response, URL_CMS_PAGE)
        self.assertEqual(page.get_title(), 'changed    title')
