I was trying to deploy a trigger from sandbox to production but was unable to do so as test run was throwing error Too many SOQL query. I tried all the best practices to avoid error too many soql query but was unable to resolve this.
But changing API versions from 23 to 33.0 solved my problem.
My question is how API version makes any difference to SOQL queries in test class.