@isTest
|
private class CampaignBTPDFControllerTest
|
{
|
@isTest
|
static void testPDF()
|
{
|
RecordType rectCam =
|
[select Id from RecordType
|
where IsActive = true and SobjectType = 'Campaign'
|
and DeveloperName = 'ServiceEngineerTraining'];
|
|
Campaign cam = new Campaign();
|
cam.Name = 'cam';
|
cam.Name2__c = '1234';
|
cam.RecordTypeId = rectCam.Id;
|
cam.StartDate = Date.today().addDays(-15);
|
cam.EndDate = Date.today().addDays(18);
|
cam.Mailflg_after45__c = true;
|
cam.Mailflg_cancel__c = true;
|
cam.Mailflg_before15__c = true;
|
cam.Mailflg_before7__c = true;
|
cam.Mailflg_after3__c = true;
|
cam.BusinessPurpose__c = '10000000000<img';
|
cam.BusinessResult__c = '10000000000<img';
|
cam.Society_Hold_Place__c = '10000000000<img';
|
// cam.BusinessPurpose_det__c = '<img alt="用户添加的图片" src="https://ocsm--StageFull--c.cs31.content.force.com/servlet/rtaImage?eid=701p0000000IX0b&feoid=00N10000008qovu&refid=0EMp00000005Fol" style="height: 500px; width: 500px;"></img><img alt="用户添加的图片" src="https://ocsm--StageFull--c.cs31.content.force.com/servlet/rtaImage?eid=701p0000000IX0b&feoid=00N10000008qovu&refid=0EMp00000005Fov" style="height: auto; width: 255px;"></img><table><span>111</span></table>';
|
cam.BusinessResult_det__c = '111<img alt="用户添加的图片" src="https://ocsmStageFullc.cs31.content.force.com/servlet/rtaImage?eid=&feoid=&refid=" style="height: 600px; width: 600px;"></img><img alt="用户添加的图片" src="https://ocsmStageFullc.cs31.content.force.com/servlet/rtaImage?eid=&feoid=&refid=" style="height: 50px; width: 50px;"></img><img alt="用户添加的图片" src="https://ocsmStageFullc.cs31.content.force.com/servlet/rtaImage?eid=&feoid=&refid="></img><table>111</table>111';
|
insert cam;
|
PageReference page = new PageReference('/apex/CampaignBTPDF?id='+cam.id);
|
page.setRedirect(true);
|
System.Test.setCurrentPage(page);
|
CampaignBTPDFController conTest = new CampaignBTPDFController();
|
conTest.init();
|
}
|
}
|