-
-
Save lemonlatte/4123625 to your computer and use it in GitHub Desktop.
Django testrunner for mongoengine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test.simple import DjangoTestSuiteRunner | |
from django.test import TransactionTestCase | |
from mongoengine import connect | |
class TestRunner(DjangoTestSuiteRunner): | |
def setup_databases(self, **kwangs): | |
db_name = 'testsuite' | |
connect(db_name) | |
print 'Creating test-database: ' + db_name | |
return db_name | |
def teardown_databases(self, db_name, **kwargs): | |
from pymongo import Connection | |
conn = Connection() | |
conn.drop_database(db_name) | |
print 'Dropping test-database: ' + db_name | |
class TestCase(TransactionTestCase): | |
def _fixture_setup(self): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment