Fixed #14123 -- Made AdminDocs tests optional, based on the availability of docutils. Thanks to PaulM for the original report, and Łukasz Rekucki for narrowing down the cause.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13606 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2010-08-19 13:11:24 +00:00
parent 806c30cd63
commit a352154e42
1 changed files with 33 additions and 26 deletions

View File

@ -2171,6 +2171,10 @@ class UserAdminTest(TestCase):
self.assertEquals(User.objects.count(), user_count + 1) self.assertEquals(User.objects.count(), user_count + 1)
self.assertNotEquals(new_user.password, UNUSABLE_PASSWORD) self.assertNotEquals(new_user.password, UNUSABLE_PASSWORD)
try:
# If docutils isn't installed, skip the AdminDocs tests.
import docutils
class AdminDocsTest(TestCase): class AdminDocsTest(TestCase):
fixtures = ['admin-views-users.xml'] fixtures = ['admin-views-users.xml']
@ -2207,3 +2211,6 @@ class AdminDocsTest(TestCase):
# A builtin filter exists in both the index and detail # A builtin filter exists in both the index and detail
self.assertContains(response, '<h3 id="add">add</h3>') self.assertContains(response, '<h3 id="add">add</h3>')
self.assertContains(response, '<li><a href="#add">add</a></li>') self.assertContains(response, '<li><a href="#add">add</a></li>')
except ImportError:
pass