Skip to content

Commit 9339b15

Browse files
authored
travis: run django-1.11.18 tests (PyMySQL#328)
1 parent 1f6e18d commit 9339b15

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

.travis.yml

+25
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,29 @@ script:
3636
after_succes:
3737
- codecov
3838

39+
matrix:
40+
include:
41+
- &django_py27
42+
python: "2.7"
43+
install:
44+
- pip install -U pip
45+
- wget https://github.com/django/django/archive/1.11.18.tar.gz
46+
- tar xf 1.11.18.tar.gz
47+
- pip install django-1.11.18/
48+
- cp ci/test_mysql.py django-1.11.18/tests/
49+
- pip install .
50+
51+
before_script:
52+
- mysql -e 'create user django identified by "secret"'
53+
- mysql -e 'grant all on *.* to django'
54+
- mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql mysql
55+
56+
script:
57+
- cd django-1.11.18/tests/
58+
- ./runtests.py --parallel=1 --settings=test_mysql
59+
60+
- &django_py3
61+
<<: *django_py27
62+
python: "3.7"
63+
3964
# vim: sw=2 ts=2 sts=2

ci/test_mysql.py

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This is an example test settings file for use with the Django test suite.
2+
#
3+
# The 'sqlite3' backend requires only the ENGINE setting (an in-
4+
# memory database will be used). All other backends will require a
5+
# NAME and potentially authentication information. See the
6+
# following section in the docs for more information:
7+
#
8+
# https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/
9+
#
10+
# The different databases that Django supports behave differently in certain
11+
# situations, so it is recommended to run the test suite against as many
12+
# database backends as possible. You may want to create a separate settings
13+
# file for each of the backends you test against.
14+
15+
DATABASES = {
16+
'default': {
17+
'ENGINE': 'django.db.backends.mysql',
18+
'NAME': 'django_default',
19+
'USER': 'django',
20+
'HOST': '127.0.0.1',
21+
'PASSWORD': 'secret',
22+
'TEST': {
23+
'CHARSET': 'utf8mb4',
24+
'COLLATION': 'utf8mb4_general_ci',
25+
},
26+
},
27+
'other': {
28+
'ENGINE': 'django.db.backends.mysql',
29+
'NAME': 'django_other',
30+
'USER': 'django',
31+
'HOST': '127.0.0.1',
32+
'PASSWORD': 'secret',
33+
'TEST': {
34+
'CHARSET': 'utf8mb4',
35+
'COLLATION': 'utf8mb4_general_ci',
36+
},
37+
}
38+
}
39+
40+
SECRET_KEY = "django_tests_secret_key"
41+
42+
# Use a fast hasher to speed up tests.
43+
PASSWORD_HASHERS = [
44+
'django.contrib.auth.hashers.MD5PasswordHasher',
45+
]

0 commit comments

Comments
 (0)