def setUp(self):
        u = self._create_user("test", True, True)

        with self.login_user_context(u):
            # add a new text plugin
            self.page_data = self.get_new_page_data()
            response = self.client.post(URL_CMS_PAGE_ADD, self.page_data)
            self.assertRedirects(response, URL_CMS_PAGE)

            page = Page.objects.all()[0]
            placeholderpk = page.placeholders.get(slot="body").pk
            post_data = {}
            get_data = {
                'plugin_type': "TextPlugin",
                'plugin_language': settings.LANGUAGES[0][0],
                'placeholder_id': placeholderpk,
            }
            add_url = URL_CMS_PLUGIN_ADD + '?' + urlencode(get_data)
            response = self.client.post(add_url, post_data)
            self.assertEqual(response.status_code, 302)
            # now edit the plugin
            pk = CMSPlugin.objects.all()[0].pk
            edit_url = URL_CMS_PLUGIN_EDIT + str(pk) + "/"
            response = self.client.get(edit_url)
            self.assertEqual(response.status_code, 200)
            response = self.client.post(edit_url, {"body": "Hello World"})
            self.assertEqual(response.status_code, 200)
            txt = Text.objects.all()[0]
            self.assertEqual("Hello World", txt.body)
            self.txt = txt
            # change the content
            response = self.client.post(edit_url, {"body": "Bye Bye World"})
            self.assertEqual(response.status_code, 200)
            txt = Text.objects.all()[0]
            self.assertEqual("Bye Bye World", txt.body)
            p_data = self.page_data.copy()
            response = self.client.post(URL_CMS_PAGE_CHANGE % page.pk, p_data)
            self.assertRedirects(response, URL_CMS_PAGE)
            page.publish('en')

        self.user = u
dataset/ETHPy150Open divio/django-cms/cms/tests/test_reversion_tests.py/ReversionTestCase.setUp/original