Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.703
diff -u -p -r1.703 comment.module
--- modules/comment/comment.module	20 Apr 2009 21:28:13 -0000	1.703
+++ modules/comment/comment.module	25 Apr 2009 20:40:43 -0000
@@ -1016,6 +1016,7 @@ function comment_links($comment, $return
     }
     else {
       $node = node_load($comment->nid);
+      $links['comment_forbidden']['html'] = TRUE;
       $links['comment_forbidden']['title'] = theme('comment_post_forbidden', $node);
     }
   }
Index: modules/comment/comment.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.test,v
retrieving revision 1.28
diff -u -p -r1.28 comment.test
--- modules/comment/comment.test	31 Mar 2009 01:49:50 -0000	1.28
+++ modules/comment/comment.test	25 Apr 2009 20:40:44 -0000
@@ -164,18 +164,20 @@ class CommentHelperCase extends DrupalWe
   /**
    * Set anonymous comment setting.
    *
-   * @param boolean $enabled
+   * @param boolean $access_comments
+   *   Allow anonymous commenting.
+   * @param boolean $post_comments
    *   Allow anonymous commenting.
    * @param boolean $without_approval
    *   Allow anonymous commenting without approval.
    */
-  function setAnonymousUserComment($enabled, $without_approval) {
+  function setAnonymousUserComment($access_comments, $post_comments, $without_approval) {
     $edit = array();
-    $edit['1[access comments]'] = $enabled;
-    $edit['1[post comments]'] = $enabled;
+    $edit['1[access comments]'] = $access_comments;
+    $edit['1[post comments]'] = $post_comments;
     $edit['1[post comments without approval]'] = $without_approval;
     $this->drupalPost('admin/user/permissions', $edit, t('Save permissions'));
-    $this->assertText(t('The changes have been saved.'), t('Anonymous user comments ' . ($enabled ? 'enabled' : 'disabled') . '.'));
+    $this->assertText(t('The changes have been saved.'), t('Anonymous user comments ' . ($access_comments ? 'access comments' : 'not access comments'). '.'));
   }
 
   /**
@@ -373,7 +375,7 @@ class CommentAnonymous extends CommentHe
   function testAnonymous() {
     $this->drupalLogin($this->admin_user);
     // Enabled anonymous user comments.
-    $this->setAnonymousUserComment(TRUE, TRUE);
+    $this->setAnonymousUserComment(TRUE, TRUE, TRUE);
     $this->setCommentAnonymous('0'); // Ensure that doesn't require contact info.
     $this->drupalLogout();
 
@@ -436,7 +438,7 @@ class CommentAnonymous extends CommentHe
 
     // Reset.
     $this->drupalLogin($this->admin_user);
-    $this->setAnonymousUserComment(FALSE, FALSE);
+    $this->setAnonymousUserComment(FALSE, FALSE, FALSE);
 
     // Attempt to view comments while disallowed.
     // NOTE: if authenticated user has permission to post comments, then a
@@ -451,6 +453,15 @@ class CommentAnonymous extends CommentHe
     $this->assertText('You are not authorized to view comments', t('Error attempting to post comment.'));
     $this->assertNoFieldByName('subject', '', t('Subject field not found.'));
     $this->assertNoFieldByName('comment', '', t('Comment field not found.'));
+    
+    $this->drupalLogin($this->admin_user);
+    $this->setAnonymousUserComment(TRUE, FALSE, FALSE);
+    $this->drupalLogout();
+    $this->drupalGet('node/' . $this->node->nid);
+    $this->assertRaw('<div id="comments">', t('Comments were displayed.'));
+    $this->assertLink('Login', 0, t('Link to login was found.'));
+    $this->assertLink('register', 0, t('Link to register was found.'));
+    
   }
 }
 
@@ -470,7 +481,7 @@ class CommentApprovalTest extends Commen
     $this->drupalLogin($this->admin_user);
 
     // Set anonymous comments to require approval.
-    $this->setAnonymousUserComment(TRUE, FALSE);
+    $this->setAnonymousUserComment(TRUE, TRUE, FALSE);
     $this->setCommentAnonymous('0'); // Ensure that doesn't require contact info.
     $this->drupalLogout();
 
@@ -504,7 +515,7 @@ class CommentApprovalTest extends Commen
     $this->drupalLogin($this->admin_user);
 
     // Set anonymous comments to require approval.
-    $this->setAnonymousUserComment(TRUE, FALSE);
+    $this->setAnonymousUserComment(TRUE, TRUE, FALSE);
     $this->setCommentAnonymous('0'); // Ensure that doesn't require contact info.
     $this->drupalLogout();
 
