          
          # 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'))
          u.save()
  
      def testActionsNonModerator(self):
          comments = self.createSomeComments()
          self.client.login(username="normaluser", password="normaluser")
 
</s> remove admin.autodiscover()
 </s> add # 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) </s> remove     (r'^admin/', include(admin.site.urls)),
 </s> add     (r'^admin/', include(admin_site.urls)),
        perms = Permission.objects.filter(
            content_type__app_label = 'comments', 
            codename__endswith = 'comment'
        )
        for perm in perms:
            u.user_permissions.add(perm)
          
          # Make "normaluser" a moderator
          u = User.objects.get(username="normaluser")
          u.is_staff = True
        perms = Permission.objects.filter(
            content_type__app_label = 'comments', 
            codename__endswith = 'comment'
        )
        for perm in perms:
            u.user_permissions.add(perm)
        perms = Permission.objects.filter(
            content_type__app_label = 'comments', 
            codename__endswith = 'comment'
        )
        for perm in perms:
            u.user_permissions.add(perm)
        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):
          comments = self.createSomeComments()
          self.client.login(username="normaluser", password="normaluser")
keep keep keep keep replace replace replace keep keep keep keep keep
 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 
tests/regressiontests/comment_tests/tests/moderation_view_tests.py