Skip to content

Commit

Permalink
Merge pull request #11 from kckaiwei/master
Browse files Browse the repository at this point in the history
Adding Django 3.0 support
  • Loading branch information
kckaiwei authored Jun 22, 2020
2 parents 1f32399 + 11be9df commit 4dcb745
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 3 deletions.
22 changes: 21 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
sudo: false
dist: trusty
dist: xenial
language: python
python:
- "2.7"
- "3.6"
- "3.7"
- "3.8"
addons:
postgresql: "9.5"
env:
Expand All @@ -15,12 +17,30 @@ env:
- DJANGO=1.11
- DJANGO=2.0
- DJANGO=2.1
- DJANGO=3.0
- DJANGO=3.0.7
matrix:
exclude:
- python: "2.7"
env: DJANGO=2.0
- python: "2.7"
env: DJANGO=2.1
- python: "2.7"
env: DJANGO=3.0
- python: "2.7"
env: DJANGO=3.0.7
- python: "3.7"
env: DJANGO=1.9
- python: "3.7"
env: DJANGO=1.10
- python: "3.7"
env: DJANGO=1.11
- python: "3.8"
env: DJANGO=1.9
- python: "3.8"
env: DJANGO=1.10
- python: "3.8"
env: DJANGO=1.11
install:
- pip install django==${DJANGO} Pillow psycopg2
- pip install .
Expand Down
2 changes: 1 addition & 1 deletion jsonate/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def _deserialize(self, value):

return value

def from_db_value(self, value, expression, connection, context):
def from_db_value(self, value, expression, connection, context=None):
return self._deserialize(value)

def to_python(self, value):
Expand Down
23 changes: 23 additions & 0 deletions test_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@
os.path.join(PROJECT_ROOT, 'templates'),
)

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
"django.contrib.auth.context_processors.auth",
"django.template.context_processors.debug",
"django.template.context_processors.i18n",
"django.template.context_processors.media",
"django.template.context_processors.static",
"django.template.context_processors.tz",
"django.template.context_processors.request",
"django.contrib.messages.context_processors.messages",
],
'debug': True,
},
}
]

SECRET_KEY = "dna_kzxq8(QbM=-#ZyyA&k,Fi1LU>&bQ4ZA+|(e<g-.%L0JnaK"

MIDDLEWARE_CLASSES = (
Expand All @@ -34,6 +54,8 @@
'django.contrib.messages.middleware.MessageMiddleware',
)

MIDDLEWARE = MIDDLEWARE_CLASSES

ROOT_URLCONF = 'test_project.urls'

SITE_ID = 1
Expand All @@ -44,6 +66,7 @@
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.messages',

'jsonate',
'test_app',
Expand Down
3 changes: 2 additions & 1 deletion test_project/test_app/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def destroy_media_folder(folder):
[unlink(f) for f in glob(join(path, "*"))]
try: rmdir(path)
except: pass



class JsonateTests(TestCase):
maxDiff = 10**4
def setUp(self):
Expand Down

0 comments on commit 4dcb745

Please sign in to comment.