def setUp(self): load_fixtures(self) cleanup_files() self.client = Client() self.form_factory = self.simpleform.as_form() self.form_fields = self.form_factory.fields self.form_postdata = { "subscribe-form-uuid": self.form_fields["uuid"].initial, "subscribe-form-form_id": self.form_fields["form_id"].initial, "subscribe-form-salutation": "Mr", "subscribe-form-name": "Name Surname", "subscribe-form-email-address": "*****@*****.**", "subscribe-form-accept-terms": True, "subscribe-form-to-email": "*****@*****.**", "subscribe-form-subject": "Test Email", "subscribe-form-upload-to": "uploads/test", "subscribe-form-id-copy": SimpleUploadedFile("test.txt", "Test") } self.user = get_user_model().objects.create(username="******") self.user.set_password("testpass") self.user.save() self.loginform_factory = self.loginform.as_form() self.loginform_fields = self.loginform_factory.fields self.loginform_postdata = { "login-form-uuid": self.form_fields["uuid"].initial, "login-form-form_id": self.form_fields["form_id"].initial, "login-form-username": "******", "login-form-password": "******" }
def setUp(self): load_fixtures(self) self.form_factory = self.simpleform.as_form() self.form_fields = self.form_factory.fields self.loginform_postdata = { "login-form-uuid": self.form_fields["uuid"].initial, "login-form-form_id": self.form_fields["form_id"].initial, "login-form-username": "******", "login-form-password": "******" }
def setUp(self): load_fixtures(self) self.client = Client() self.editor = get_user_model().objects.create( username="******", email="*****@*****.**", is_superuser=True, is_staff=True ) self.editor.set_password("password") self.editor.save() self.client.login(username="******", password="******")
def setUp(self): load_fixtures(self) cleanup_files() self.form_factory = self.simpleform.as_form() self.form_fields = self.form_factory.fields self.form_data = { "subscribe-form-uuid": self.form_fields["uuid"].initial, "subscribe-form-form_id": self.form_fields["form_id"].initial, "subscribe-form-salutation": "Mr", "subscribe-form-name": "Name Surname", "subscribe-form-email-address": "*****@*****.**", "subscribe-form-accept-terms": True, "subscribe-form-to-email": "*****@*****.**", "subscribe-form-subject": "Test Email", "subscribe-form-upload-to": "uploads/test" } self.form_files = { "subscribe-form-id-copy": SimpleUploadedFile("test.txt", "Test") } self.upload_path = os.path.join( settings.MEDIA_ROOT, self.form_data["subscribe-form-upload-to"] )
def setUp(self): load_fixtures(self)
def setUpTestData(cls): load_fixtures(cls)
def setUp(self): super(WizardViewTestCase, self).setUp() load_fixtures(self)
def setUp(self): load_fixtures(self) self.dummy_form_instance = DummyForm()