File: test_mysql.py

package info (click to toggle)
python-pymysql 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 848 kB
  • sloc: python: 6,396; makefile: 134; sh: 44; sql: 10
file content (47 lines) | stat: -rw-r--r-- 1,498 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This is an example test settings file for use with the Django test suite.
#
# The 'sqlite3' backend requires only the ENGINE setting (an in-
# memory database will be used). All other backends will require a
# NAME and potentially authentication information. See the
# following section in the docs for more information:
#
# https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/
#
# The different databases that Django supports behave differently in certain
# situations, so it is recommended to run the test suite against as many
# database backends as possible.  You may want to create a separate settings
# file for each of the backends you test against.

import pymysql

pymysql.install_as_MySQLdb()

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.mysql",
        "NAME": "django_default",
        "HOST": "127.0.0.1",
        "USER": "scott",
        "PASSWORD": "tiger",
        "TEST": {"CHARSET": "utf8mb3", "COLLATION": "utf8mb3_general_ci"},
    },
    "other": {
        "ENGINE": "django.db.backends.mysql",
        "NAME": "django_other",
        "HOST": "127.0.0.1",
        "USER": "scott",
        "PASSWORD": "tiger",
        "TEST": {"CHARSET": "utf8mb3", "COLLATION": "utf8mb3_general_ci"},
    },
}

SECRET_KEY = "django_tests_secret_key"

# Use a fast hasher to speed up tests.
PASSWORD_HASHERS = [
    "django.contrib.auth.hashers.MD5PasswordHasher",
]

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

USE_TZ = False