def setUpClass(cls):
        """Open a connection to the database.

        Returns:

        """
        # open an connection to a mock database
        cls.database = Database(MOCK_DATABASE_HOST, MOCK_DATABASE_NAME)
        cls.database.connect()
Пример #2
0
    # Local apps
    "core_main_app",
    "tests",
]

# SERVER URI
SERVER_URI = "http://my.curator.com"

# IN-MEMORY TEST DATABASE
DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": ":memory:",
        "USER": "",
        "PASSWORD": "",
        "HOST": "",
        "PORT": "",
    },
}

PASSWORD_HASHERS = ('django.contrib.auth.hashers.UnsaltedMD5PasswordHasher', )

MOCK_DATABASE_NAME = 'db_mock'
MOCK_DATABASE_HOST = 'mongomock://localhost'

DATA_SORTING_FIELDS = ['+title']

database = Database(MOCK_DATABASE_HOST, MOCK_DATABASE_NAME)
database.connect()