def test_form_copy(self): form_params = FormParameters() form_params.add_input([("name", "username"), ("type", "text")]) form_params.add_input([("name", "pwd"), ("type", "password")]) form = Form(form_params) form.set_token(('username', 0)) form_copy = copy.deepcopy(form) self.assertEqual(form.get_token(), form_copy.get_token()) self.assertIsNot(None, form_copy.get_token())
def test_form_copy(self): form_params = FormParameters() form_params.add_field_by_attrs({'name': 'username', 'type': 'text'}) form_params.add_field_by_attrs({'name': 'pwd', 'type': 'password'}) form = Form(form_params) form.set_token(('username', 0)) form_copy = copy.deepcopy(form) self.assertEqual(form.get_token(), form_copy.get_token()) self.assertIsNot(None, form_copy.get_token())