Kaydet (Commit) 9f70783b authored tarafından Jacob Kaplan-Moss's avatar Jacob Kaplan-Moss

Fixed a couple of test-ordering-dependant failures introduced in [11639] that…

Fixed a couple of test-ordering-dependant failures introduced in [11639] that caused test failures when running the whole test suite.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11645 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 0d1177ae
...@@ -168,9 +168,12 @@ class AdminActionsTests(CommentTestCase): ...@@ -168,9 +168,12 @@ class AdminActionsTests(CommentTestCase):
# Make "normaluser" a moderator # Make "normaluser" a moderator
u = User.objects.get(username="normaluser") u = User.objects.get(username="normaluser")
u.is_staff = True u.is_staff = True
u.user_permissions.add(Permission.objects.get(codename='add_comment')) perms = Permission.objects.filter(
u.user_permissions.add(Permission.objects.get(codename='change_comment')) content_type__app_label = 'comments',
u.user_permissions.add(Permission.objects.get(codename='delete_comment')) codename__endswith = 'comment'
)
for perm in perms:
u.user_permissions.add(perm)
u.save() u.save()
def testActionsNonModerator(self): def testActionsNonModerator(self):
......
from django.conf.urls.defaults import * from django.conf.urls.defaults import *
from django.contrib import admin from django.contrib import admin
from django.contrib.comments.admin import CommentsAdmin
from django.contrib.comments.models import Comment
admin.autodiscover() # Make a new AdminSite to avoid picking up the deliberately broken admin
# modules in other tests.
admin_site = admin.AdminSite()
admin_site.register(Comment, CommentsAdmin)
urlpatterns = patterns('', urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)), (r'^admin/', include(admin_site.urls)),
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment