Bhuvarahan / npsp

Automatically exported from code.google.com/p/npsp
0 stars 0 forks source link

When upgrading, the Individual Account must be renamed to avoid test failures #141

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Upgrade a package in an org with an Account named "Individual"
2. Note test failures

Perhaps we can modify the tests to avoid this problem. Probably requires an 
"inTest" flag so that 
the tests won't use the real data, thereby getting around the data problem.

Original issue reported on code.google.com by gok...@gmail.com on 13 Nov 2009 at 3:34

GoogleCodeExporter commented 8 years ago
Modifying the tests won't solve this because the Individual Account will be 
accessed from the tests of the other 
packages. In the relationships tests, Contacts are created which will kick off 
the contacts and Organizations code.

I will track down the actual cause of the failures to see what cases cause 
problems and then go from there.

Original comment by gok...@gmail.com on 13 Nov 2009 at 4:04

GoogleCodeExporter commented 8 years ago
It appears that one problem is that the the Individual Account doesn't have 
other fields set correctly:

SYSTEMISINDIVIDUAL__c = true
SYSTEM_AccountType__c = Constants.BUCKET_ORGANIZATION_TYPE

I can't set those in a test, but I can get the tests around that error.

Could I set those field in the code? First time a contact is created, I could 
set that right. Can I do it with 
governor limits as they are?

Original comment by gok...@gmail.com on 23 Nov 2009 at 10:48

GoogleCodeExporter commented 8 years ago
The fix has three parts:

1. Pull out a method that gets the individual account Id. Once this is pulled 
out we can then affect it from our 
tests

2. In the tests, tweak the individual Account name, so that it doesn't conflict 
with the real individual account 
name

3. Add code to the get individual account id test that actually changes the 
data on the Inidividual account if 
it's not right. This deals with a situation where someone in installing the 
NPSP into an org that already has an 
account named individual.

The tests are no longer data dependent. And they all pass. Also, if there is an 
account named "individual" and 
the account model is switched to "Individual Account", the Account named 
"Individual" is fixed automatically.

Original comment by gok...@gmail.com on 23 Nov 2009 at 11:11

GoogleCodeExporter commented 8 years ago
Fixed by r232

Original comment by gok...@gmail.com on 24 Nov 2009 at 3:12