openmrs/openmrs-core — pull request #119 by rapilabs (2012-11-16 15:12:10+00:00)
Title: Patch to query db without dereferencing the names collection

Just a simple fix here to avoid dereferencing the names collection in the order by.

The additional test only checks to see if the exception occurs under the same conditions.

*Note* there are no existing tests to check for any regression. I also haven't written any tests to test the behaviour of the method as I wasn't quite sure how the tests prep the database with data.

It looks as though all the datasets are combined; to test the method correctly I would ideally like to delete the concept data and setup a fresh concept dictionary to make sure the conditions are met correctly. If someone knows how to reset only the concept dictionary then I'd be happy to write these tests.