Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.603
diff -u -p -r1.603 taxonomy.module
--- modules/taxonomy/taxonomy.module	22 Aug 2010 15:45:03 -0000	1.603
+++ modules/taxonomy/taxonomy.module	24 Aug 2010 22:51:40 -0000
@@ -298,6 +298,8 @@ function taxonomy_menu() {
     'page arguments' => array('taxonomy_form_term', 2),
     'access callback' => 'taxonomy_term_edit_access',
     'access arguments' => array(2),
+    'theme callback' => 'variable_get',
+    'theme arguments' => array('admin_theme'),
     'type' => MENU_LOCAL_TASK,
     'weight' => 10,
     'file' => 'taxonomy.admin.inc',
@@ -356,6 +358,16 @@ function taxonomy_menu() {
 }
 
 /**
+ * Implements hook_admin_paths().
+ */
+function taxonomy_admin_paths() {
+  $paths = array(
+    'taxonomy/term/*/edit' => TRUE,
+  );
+  return $paths;
+}
+
+/**
  * Return edit access for a given term.
  */
 function taxonomy_term_edit_access($term) {
Index: modules/taxonomy/taxonomy.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v
retrieving revision 1.90
diff -u -p -r1.90 taxonomy.test
--- modules/taxonomy/taxonomy.test	22 Aug 2010 15:45:03 -0000	1.90
+++ modules/taxonomy/taxonomy.test	24 Aug 2010 22:51:40 -0000
@@ -1097,3 +1097,50 @@ class TaxonomyTokenReplaceTestCase exten
     }
   }
 }
+
+/**
+ * Tests for verifying that taxonomy pages use the correct theme.
+ */
+class TaxonomyThemeTestCase extends TaxonomyWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Taxonomy theme switching',
+      'description' => 'Verifies that various taxonomy pages use the expected theme.',
+      'group' => 'Taxonomy',
+    );
+  }
+
+  function setUp() {
+    parent::setUp();
+
+    // Make sure we are using distinct default and administrative themes for
+    // the duration of these tests.
+    variable_set('theme_default', 'bartik');
+    variable_set('admin_theme', 'seven');
+
+    // Create and log in as a user who has permission to add and edit taxonomy
+    // terms.
+    $admin_user = $this->drupalCreateUser(array('administer taxonomy'));
+    $this->drupalLogin($admin_user);
+  }
+
+  /**
+   * Test the theme used when adding, viewing and editing taxonomy terms.
+   */
+  function testTaxonomyTermThemes() {
+    // Adding a term to a vocabulary is considered an administrative action and
+    // should use the administrative theme.
+    $vocabulary = $this->createVocabulary();
+    $this->drupalGet('admin/structure/taxonomy/' . $vocabulary->machine_name . '/add');
+    $this->assertRaw('seven/style.css', t("The administrative theme's CSS appears on the page for adding a taxonomy term."));
+
+    // Viewing a taxonomy term should use the default theme.
+    $term = $this->createTerm($vocabulary);
+    $this->drupalGet('taxonomy/term/' . $term->tid);
+    $this->assertRaw('bartik/css/style.css', t("The default theme's CSS appears on the page for viewing a taxonomy term."));
+
+    // Editing a taxonomy term should use the same theme as adding one.
+    $this->drupalGet('taxonomy/term/' . $term->tid . '/edit');
+    $this->assertRaw('seven/style.css', t("The administrative theme's CSS appears on the page for editing a taxonomy term."));
+  }
+}
