Skip to content

Commit

Permalink
Fixed a couple of test-ordering-dependant failures introduced in [116…
Browse files Browse the repository at this point in the history
…39] 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
  • Loading branch information
jacobian committed Oct 24, 2009
1 parent 0d1177a commit 9f70783
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Expand Up @@ -168,9 +168,12 @@ def setUp(self):
# Make "normaluser" a moderator
u = User.objects.get(username="normaluser")
u.is_staff = True
u.user_permissions.add(Permission.objects.get(codename='add_comment'))
u.user_permissions.add(Permission.objects.get(codename='change_comment'))
u.user_permissions.add(Permission.objects.get(codename='delete_comment'))
perms = Permission.objects.filter(
content_type__app_label = 'comments',
codename__endswith = 'comment'
)
for perm in perms:
u.user_permissions.add(perm)
u.save()

def testActionsNonModerator(self):
Expand Down
9 changes: 7 additions & 2 deletions tests/regressiontests/comment_tests/urls_admin.py
@@ -1,8 +1,13 @@
from django.conf.urls.defaults import *
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('',
(r'^admin/', include(admin.site.urls)),
(r'^admin/', include(admin_site.urls)),
)

0 comments on commit 9f70783

Please sign in to comment.