Source

openju / tests / base.py

Full commit
# -*- coding: utf-8 -*-

from mongoengine import connect

class SimpleTestDb(object):
    dbname = 'openju_simple_test_db'
    
    def __enter__(self):
        self.db = connect(self.__class__.dbname)
        return self.db
    
    def __exit__(self):
        self.db.remove()
        self.db.disconnect()