deleted 35 characters in body
Source Link
Kris Goncalves
  • 15.1k
  • 3
  • 15
  • 44

I had the exact same problem, even flagging (SeeAllData=false) explicitly. It appears that even in test cases SF validates the SKU across all product records

It appears that even in test cases SF validates the SKU across all product records. 

I got around it in my test classes by ensuring the product SKU was guaranteed to be uniqueunique & not match anything in an existingexisting product record (in my case I appended 'SF-UNITTEST-' to all SKUs in my spoofed http requests). Hope this helps someone else who had this problem!

I had the exact same problem, even flagging (SeeAllData=false) explicitly. It appears that even in test cases SF validates the SKU across all product records. I got around it in my test classes by ensuring the product SKU was guaranteed to be unique & not match anything in an existing product record (in my case I appended 'SF-UNITTEST-' to all SKUs in my spoofed http requests). Hope this helps someone else who had this problem!

I had the exact same problem, even flagging (SeeAllData=false) explicitly.

It appears that even in test cases SF validates the SKU across all product records. 

I got around it in my test classes by ensuring the product SKU was guaranteed to be unique & not match anything in an existing product record (in my case I appended 'SF-UNITTEST-' to all SKUs in my spoofed http requests).

Source Link
S Vai
  • 51
  • 2

I had the exact same problem, even flagging (SeeAllData=false) explicitly. It appears that even in test cases SF validates the SKU across all product records. I got around it in my test classes by ensuring the product SKU was guaranteed to be unique & not match anything in an existing product record (in my case I appended 'SF-UNITTEST-' to all SKUs in my spoofed http requests). Hope this helps someone else who had this problem!