pytest-dev / pytest-django

A Django plugin for pytest.
https://pytest-django.readthedocs.io/
Other
1.33k stars 341 forks source link

How to use mysql back-end from a file for tests #999

Open manycoding opened 2 years ago

manycoding commented 2 years ago

Could somebody point me to how I can set mysql back-end up?

At the moment I have sqlite which simply reads from a file, I want something similar but with mysql.

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": "tests/test_db.sqlite",
    },
    "reader": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": "tests/test_db.sqlite",
    },
}
hramezani commented 2 years ago

Could somebody point me to how I can set mysql back-end up?

Take a look at Django database settings.

I think this repo is not the place for asking Django configuration-related questions.

manycoding commented 2 years ago

But this tool provides certain features to simplify the setup. I am trying to wrap my head around it.