Index: modules/filter/filter.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.test,v
retrieving revision 1.79
diff -u -p -r1.79 filter.test
--- modules/filter/filter.test	22 Oct 2010 16:36:14 -0000	1.79
+++ modules/filter/filter.test	23 Oct 2010 02:06:05 -0000
@@ -497,9 +497,18 @@ class FilterFormatAccessTestCase extends
     // the disallowed format does not.
     $this->drupalLogin($this->web_user);
     $this->drupalGet('node/add/page');
-    $this->assertRaw($this->formatSelectorHTML($this->allowed_format), t('The allowed text format appears as an option when adding a new node.'));
-    $this->assertNoRaw($this->formatSelectorHTML($this->disallowed_format), t('The disallowed text format does not appear as an option when adding a new node.'));
-    $this->assertRaw($this->formatSelectorHTML(filter_format_load(filter_fallback_format())), t('The fallback format appears as an option when adding a new node.'));
+    $langcode = LANGUAGE_NONE;
+    $elements = $this->xpath('//select[@name=:name]/option', array(
+      ':name' => "body[$langcode][0][format]",
+      ':option' => $this->allowed_format->format,
+    ));
+    $options = array();
+    foreach ($elements as $element) {
+      $options[(string) $element['value']] = $element;
+    }
+    $this->assertTrue(isset($options[$this->allowed_format->format]), t('The allowed text format appears as an option when adding a new node.'));
+    $this->assertFalse(isset($options[$this->disallowed_format->format]), t('The disallowed text format does not appear as an option when adding a new node.'));
+    $this->assertTrue(isset($options[filter_fallback_format()]), t('The fallback format appears as an option when adding a new node.'));
   }
 
   function testFormatRoles() {
@@ -645,18 +654,6 @@ class FilterFormatAccessTestCase extends
   }
 
   /**
-   * Returns the expected HTML for a particular text format selector.
-   *
-   * @param $format
-   *   An object representing the text format for which to return HTML.
-   * @return
-   *   The expected HTML for that text format's selector.
-   */
-  function formatSelectorHTML($format) {
-    return '<option value="' . $format->format . '">' . $format->name . '</option>';
-  }
-
-  /**
    * Rebuild text format and permission caches in the thread running the tests.
    */
   protected function resetFilterCaches() {
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.242
diff -u -p -r1.242 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	20 Oct 2010 15:22:53 -0000	1.242
+++ modules/simpletest/drupal_web_test_case.php	23 Oct 2010 01:56:23 -0000
@@ -3020,6 +3020,8 @@ class DrupalWebTestCase extends DrupalTe
    *   Message to display.
    * @return
    *   TRUE on pass, FALSE on fail.
+   *
+   * @todo $id is unusable. Replace with $name.
    */
   protected function assertOptionSelected($id, $option, $message = '') {
     $elements = $this->xpath('//select[@id=:id]//option[@value=:option]', array(':id' => $id, ':option' => $option));
