Fix unit tests with the latest LocalSiteProfile counter changes.
Review Request #6924 — Created Feb. 8, 2015 and submitted — Latest diff uploaded
The recent changes to show the LocalSiteProfile models inline in the User admin UI page broke unit tests, due to a bad assumption in the new conditionals that the queries should return 0 if the LocalSiteProfile hasn't yet been saved. This situation is actually valid, because the related objects being counted are based off the User, not the LocalSiteProfile. So, instead, we need to have the conditionals check into the associated user ID. This fixes all unit tests, and the original failure case of viewing the User admin page.
Unit tests pass.
I could use the User pages without any errors.