I've added a MongoTestRunner that supports both Mongo and RDBMS backends. I've tested the new runner in the following contexts:
All tests were conducted with Django 1.4
The commit also adds a Testing section to the MongoEngine Django docs. I'm happy to modify the code or docs as you see fit. Let me know. Thanks!
add MongoTestRunner and modify MongoTestCase
MongoTestRunner now supports both Mongo and RDBMS backends.
Also added Testing section to Django docs.
Seems some overlap with MongoEngine/mongoengine#51 - any thoughts on either approach?
The TestSuiteRunner and TestCase in Pull Request 51 only support a stand-alone Mongo environment.
In other words, they will not allow you to run both Django ORM-backed tests and Mongo tests using the standard python manage.py test syntax.
I started out with such an approach, but because it's so common to have mixed RDBMS + Mongo environments, I decided to build a Test Suite Runner that handles all combinations (RDBMS-only, RDBMS+Mongo, Mongo-only).
Would it make sense to have two Test Runners and associated Test Cases? If so, lig and I could rename our Runner and TestCase classes to better reflect their purposes. For instance, MongoStandaloneTestSuiteRunner and MongoDjangoTestSuiteRunner (I'll admit, those are probably a bit verbose). Thoughts?
This does not work completely if there is no DATABASES section in the settings at all.
@zstumgoren please look at my django-testing-utils branch. I've added hybrid classes to let the developer to choose at his own to use or not to use settings.DATABASES and RDBMS at all.
Personally I think that it is enough for all Django/Mongoengine setups.
I haven't tested your solution, but it looks like it covers all scenarios. Nicely done. I'm fine using that solution if Ross signs off on it.