Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
An example project that uses a custom TestCase and TEST_RUNNER in order to keep a clean mongoDB test database between the tests
Python
Branch: master
Pull request Compare This branch is 8 commits ahead, 14 commits behind vandersonmota:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
example
.gitignore
README.mkd
__init__.py
manage.py
mongotest.py
settings.py
urls.py

README.mkd

Authors:

Usage:

All you have to do is use MongoEngineTestCase as the base class for your test cases. Here is a simple example:

from example.models import Book
from mongotest import MongoEngineTestCase

class ExampleTestCase(MongoEngineTestCase):
    def test_Book_creation(self):
        self.assertFalse(Book.objects())
        Book(name='The Book', pages=500).save()
        self.assertTrue(Book.objects())

for this, you must define a NOSQL_DATABASE_NAME in your settings.py file, like so:

NOSQL_DATABASE_NAME = 'example'
Something went wrong with that request. Please try again.