def test_flatpage_admin_form_edit(self):
        existing = FlatPage.objects.create(
            url="/myflatpage1/", title="Some page", content="The content")
        existing.sites.add(settings.SITE_ID)

        data = dict(url='/myflatpage1/', **self.form_data)

        f = FlatpageForm(data=data, instance=existing)

        self.assertTrue(f.is_valid(), f.errors)

        updated = f.save()

        self.assertEqual(updated.title, "A test page")
Generates the main object and user instance if needed.
dataset/ETHPy150Open django/django/tests/flatpages_tests/test_forms.py/FlatpageAdminFormTests.test_flatpage_admin_form_edit--crossover with--dataset/ETHPy150Open ydaniv/django-rest-assured/rest_assured/testcases.py/BaseRESTAPITestCase.setUp