'Test that a page can be created via the admin'

def test_create_page_admin(self):

    page_data = self.get_new_page_data()
    superuser = self.get_superuser()
    with self.login_user_context(superuser):
        self.assertEqual(Title.objects.all().count(), 0)
        self.assertEqual(Page.objects.all().count(), 0)
        response = self.client.post(URL_CMS_PAGE_ADD, page_data)
        self.assertRedirects(response, URL_CMS_PAGE)
        page_data = self.get_new_page_data()
        response = self.client.post(URL_CMS_PAGE_ADD, page_data)
        self.assertRedirects(response, URL_CMS_PAGE)
        title = Title.objects.drafts().get(slug=page_data['slug'])
        self.assertRaises(Title.DoesNotExist, Title.objects.public().get, slug=page_data['slug'])
        page = title.page
        page.save()
        page.publish('en')
        self.assertEqual(page.get_title(), page_data['title'])
        self.assertEqual(page.get_slug(), page_data['slug'])
        self.assertEqual(page.placeholders.all().count(), 2)
        self.assertEqual(Title.objects.all().count(), 4)
        title = Title.objects.drafts().get(slug=page_data['slug'])
        title = Title.objects.public().get(slug=page_data['slug'])
