Commits

Carl Meyer  committed b4b057a

Added tox config.

  • Participants
  • Parent commits 85b1ef0

Comments (0)

Files changed (3)

 ^django_model_utils.egg-info/
 ^HGREV$
 ^.coverage$
+^.tox/

File model_utils/tests/tests.py

 from datetime import datetime, timedelta
 
+import django
 from django.test import TestCase
 from django.conf import settings
 from django.db import models
 
 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
                           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):
+[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