1

I'm looking for a way to test my Django app that works with MongoDB using Djongo.

I found Django Test Addons library but as I understood, it only works with mongoengine. Is there any manner to make it work with Djongo or do you know another similar library that I can use?

dfuente
  • 11
  • 2

1 Answers1

0

I just run my django tests with own config:

manage.py test --settings=myproject.settings.unit_tests

In my unit test config, I just import my base settings, and then change database name. This seems to work fine.

from .base import *

DATABASES = {
    'default': {
        'ENGINE': 'djongo',
        'NAME': 'test_myproject',
        'CLIENT': {
            'host': 'myproject-mongodb',
            'username': 'supermongo',
            'password': 'supersecret',        
        }
    }
}
user1383029
  • 1,685
  • 2
  • 19
  • 37