mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-16 20:00:23 +00:00
Added tox config.
This commit is contained in:
parent
a3c838adda
commit
1a8f7c5087
3 changed files with 76 additions and 18 deletions
|
|
@ -2,3 +2,4 @@
|
|||
^django_model_utils.egg-info/
|
||||
^HGREV$
|
||||
^.coverage$
|
||||
^.tox/
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
from datetime import datetime, timedelta
|
||||
|
||||
import django
|
||||
from django.test import TestCase
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
|
|
@ -8,7 +9,7 @@ from django.core.exceptions import ImproperlyConfigured
|
|||
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
|
||||
from model_utils import ChoiceEnum, Choices
|
||||
from model_utils import Choices
|
||||
from model_utils.fields import get_excerpt, MonitorField
|
||||
from model_utils.managers import QueryManager, manager_from
|
||||
from model_utils.models import StatusModel, TimeFramedModel
|
||||
|
|
@ -246,26 +247,30 @@ class InheritanceCastQuerysetTests(TestCase):
|
|||
set([parent, self.child, self.child2]))
|
||||
|
||||
|
||||
class InheritanceManagerTests(TestCase):
|
||||
def setUp(self):
|
||||
self.child1 = InheritanceManagerTestChild1.objects.create()
|
||||
self.child2 = InheritanceManagerTestChild2.objects.create()
|
||||
if django.VERSION >= (1, 2):
|
||||
class InheritanceManagerTests(TestCase):
|
||||
def setUp(self):
|
||||
self.child1 = InheritanceManagerTestChild1.objects.create()
|
||||
self.child2 = InheritanceManagerTestChild2.objects.create()
|
||||
|
||||
def test_normal(self):
|
||||
self.assertEquals(set(InheritanceManagerTestParent.objects.all()),
|
||||
set([
|
||||
InheritanceManagerTestParent(pk=self.child1.pk),
|
||||
InheritanceManagerTestParent(pk=self.child2.pk),
|
||||
]))
|
||||
def test_normal(self):
|
||||
self.assertEquals(set(InheritanceManagerTestParent.objects.all()),
|
||||
set([
|
||||
InheritanceManagerTestParent(pk=self.child1.pk),
|
||||
InheritanceManagerTestParent(pk=self.child2.pk),
|
||||
]))
|
||||
|
||||
def test_select_all_subclasses(self):
|
||||
self.assertEquals(set(InheritanceManagerTestParent.objects.select_subclasses()),
|
||||
set([self.child1, self.child2]))
|
||||
def test_select_all_subclasses(self):
|
||||
self.assertEquals(
|
||||
set(InheritanceManagerTestParent.objects.select_subclasses()),
|
||||
set([self.child1, self.child2]))
|
||||
|
||||
def test_select_specific_subclasses(self):
|
||||
self.assertEquals(set(InheritanceManagerTestParent.objects.select_subclasses(
|
||||
"inheritancemanagertestchild1")),
|
||||
set([self.child1, InheritanceManagerTestParent(pk=self.child2.pk)]))
|
||||
def test_select_specific_subclasses(self):
|
||||
self.assertEquals(
|
||||
set(InheritanceManagerTestParent.objects.select_subclasses(
|
||||
"inheritancemanagertestchild1")),
|
||||
set([self.child1,
|
||||
InheritanceManagerTestParent(pk=self.child2.pk)]))
|
||||
|
||||
|
||||
class TimeStampedModelTests(TestCase):
|
||||
|
|
|
|||
52
tox.ini
Normal file
52
tox.ini
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
[tox]
|
||||
envlist=py25-1.1,py25-1.2,py25,py25-trunk,py26-1.1,py26-1.2,py26,py26-trunk,py27-1.1,py27-1.2,py27,py27-trunk
|
||||
|
||||
[testenv]
|
||||
deps=
|
||||
django==1.3
|
||||
commands=python setup.py test
|
||||
|
||||
[testenv:py25-1.1]
|
||||
basepython=python2.5
|
||||
deps=
|
||||
django==1.1.4
|
||||
|
||||
[testenv:py25-1.2]
|
||||
basepython=python2.5
|
||||
deps=
|
||||
django==1.2.5
|
||||
|
||||
[testenv:py25-trunk]
|
||||
basepython=python2.5
|
||||
deps=
|
||||
svn+http://code.djangoproject.com/svn/django/trunk#egg=django
|
||||
|
||||
[testenv:py26-1.1]
|
||||
basepython=python2.6
|
||||
deps=
|
||||
django==1.1.4
|
||||
|
||||
[testenv:py26-1.2]
|
||||
basepython=python2.6
|
||||
deps=
|
||||
django==1.2.5
|
||||
|
||||
[testenv:py26-trunk]
|
||||
basepython=python2.6
|
||||
deps=
|
||||
svn+http://code.djangoproject.com/svn/django/trunk#egg=django
|
||||
|
||||
[testenv:py27-1.1]
|
||||
basepython=python2.7
|
||||
deps=
|
||||
django==1.1.4
|
||||
|
||||
[testenv:py27-1.2]
|
||||
basepython=python2.7
|
||||
deps=
|
||||
django==1.2.5
|
||||
|
||||
[testenv:py27-trunk]
|
||||
basepython=python2.7
|
||||
deps=
|
||||
svn+http://code.djangoproject.com/svn/django/trunk#egg=django
|
||||
Loading…
Reference in a new issue