Create an testable application is not such easy.
You have different types of tests, if you are using unit test, you never should call the db, webservices, even file system resources. All these stuff must be mocked. I know is hard, but if you can't you have code smell.
But, if you still need to access to the db, you can create your own testing environment, when you put a local Oracle Database and you can handle the permission as you want.
You can create a APPLICATION_ENV for your system as you can read a particular config when you run tests, just for use the Local connection and not the QA (For example) connection.