Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Require unittest2 for running tests. This comes packaged with more re…

…cent versions of Django.
  • Loading branch information...
commit 2f5df7061685eab4157a541e29cca2aa0e52cad3 1 parent 75f429f
@mlavin mlavin authored
Showing with 15 additions and 1 deletion.
  1. +2 −1  buildout.cfg
  2. +13 −0 src/moderation/tests/utils/__init__.py
View
3  buildout.cfg
@@ -7,6 +7,7 @@ eggs =
ipdb
pep8
mock
+ unittest2
[versions]
djangorecipe = 0.23.1
@@ -41,4 +42,4 @@ projectegg = example_project
project = example_project
test = moderation
testrunner = test-1.4
-eggs = ${buildout:eggs}
+eggs = ${buildout:eggs}
View
13 src/moderation/tests/utils/__init__.py
@@ -1,3 +1,16 @@
+import sys
+
+try:
+ from django.utils import unittest
+except ImportError:
+ # Django < 1.3
+ try:
+ import unittest2 as unittest
+ except ImportError:
+ if sys.version_info >= (2.7):
+ import unittest
+ else:
+ raise ImportError('unittest2 is required to run the tests.')
def setup_moderation(models=[]):

0 comments on commit 2f5df70

Please sign in to comment.
Something went wrong with that request. Please try again.