hspandher / django-test-addons

Testing support for different database system like Mongo, Redis, Neo4j, Memcache, Django Rest Framework for django
MIT License
20 stars 12 forks source link

MongoTestCase only supports 'localhost' as 'host' for the connection #6

Open omritoptix opened 7 years ago

omritoptix commented 7 years ago

I'm trying to run my tests with docker-compose and set the host in the TEST_MONGO_DATABASE to something different then localhost but the MongoTestCase ignores it. When Changed the line: mongoengine.connection.connect(self.MONGO_DB_SETTINGS['db'], port = self.MONGO_DB_SETTINGS['port']) to: mongoengine.connection.connect(self.MONGO_DB_SETTINGS['db'], host=self.MONGO_DB_SETTINGS['host'][0], port = self.MONGO_DB_SETTINGS['port']) It worked.

argoyal commented 7 years ago

@omritoptix I have fixed this issue and the pull request has been accepted by @hspandher . I think the new version has not been updated in pypi, so install the package from the source code and this will resolve your issues. Check the pull request here : https://github.com/hspandher/django-test-addons/pull/5

jakob-stoeck commented 6 years ago

Would be great to see this released to pip, e.g. as version 1.0.1