make test model django 3 compatible
All checks were successful
buildbot/tox Build done.

This commit is contained in:
2019-12-03 10:07:49 +01:00
parent 05e2337957
commit 64f7201b91
2 changed files with 11 additions and 6 deletions

View File

@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible class MyModel(models.Model): # pylint: disable=model-has-unicode
class MyModel(models.Model):
chars = models.CharField(max_length=10) chars = models.CharField(max_length=10)
def __str__(self): def __str__(self):
return self.chars return self.chars
def __unicode__(self):
return self.__str__()

10
tox.ini
View File

@@ -1,10 +1,14 @@
[tox] [tox]
envlist = py3,py2 envlist = py3-django3,py3-django2,py2-django1
[testenv] [testenv]
deps = coverage deps = coverage
py2: pylint-django<2 py2-django1: django<2
py3: pylint-django py2-django1: pylint-django<2
py3-django2: django<3
py3-django2: pylint-django
py3-django3: django
py3-django3: pylint-django
pytest pytest
mock mock
commands = coverage run -m pytest commands = coverage run -m pytest