Index: modules/locale/locale.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.test,v
retrieving revision 1.73
diff -u -p -r1.73 locale.test
--- modules/locale/locale.test	26 Jun 2010 19:55:47 -0000	1.73
+++ modules/locale/locale.test	9 Jul 2010 00:13:59 -0000
@@ -916,25 +916,33 @@ class LocaleExportFunctionalTest extends
     // Get the French translations.
     $this->drupalPost('admin/config/regional/translate/export', array(
       'langcode' => 'fr',
-    ), t('Export'));
+    ), t('Export'), array(), array(), 'locale-translate-export-po-form');
 
     // Ensure we have a translation file.
     $this->assertRaw('# French translation of Drupal', t('Exported French translation file.'));
     // Ensure our imported translations exist in the file.
     $this->assertRaw('msgstr "lundi"', t('French translations present in exported file.'));
-  }
 
-  /**
-   * Test exportation of translation template file.
-   */
-  function testExportTranslationTemplateFile() {
+    // Setup French as default site language to enable core store strings
+    // for translation. Plural formula is valid after previous import.
+    $edit = array(
+      'site_default' => 'fr',
+    );
+    $this->drupalPost('admin/config/regional/language', $edit, t('Save configuration'));
+    // Visit test page to insert module's strings with format_plural().
+    $this->drupalGet('locale-test');
+    $this->assertText('1 locale test line', t('First test line found'));
+    $this->assertText('2 locale test lines', t('Second test line found'));
+
     // Get the translation template file.
-    // There are two 'Export' buttons on this page, but it somehow works.  It'd
-    // be better if we could use the submit button id like documented but that
-    // doesn't work.
-    $this->drupalPost('admin/config/regional/translate/export', array(), t('Export'));
+    $this->drupalPost('admin/config/regional/translate/export', array(), t('Export'), array(), array(), 'locale-translate-export-pot-form');
+
     // Ensure we have a translation file.
     $this->assertRaw('# LANGUAGE translation of PROJECT', t('Exported translation template file.'));
+
+    // Ensure that the locale_test module's strings exist in the file.
+    $this->assertRaw('msgid "1 locale test line"', t('Singular string present in exported file.'));
+    $this->assertRaw('msgid "@count locale test lines"', t('Plural string present in exported file.'));
   }
 
   /**
@@ -1301,8 +1309,6 @@ class LocaleUserLanguageFunctionalTest e
     // Check if language was changed.
     $elements = $this->xpath('//input[@id=:id]', array(':id' => 'edit-language-' . $langcode));
     $this->assertTrue(isset($elements[0]) && !empty($elements[0]['checked']), t('Default language successfully updated.'));
-
-    $this->drupalLogout();
   }
 }
 
@@ -1485,8 +1491,6 @@ class LocalePathFunctionalTest extends D
     // Confirm custom language path alias works.
     $this->drupalGet($prefix . '/' . $custom_language_path);
     $this->assertText($node->title, t('Custom language alias works.'));
-
-    $this->drupalLogout();
   }
 }
 
@@ -1606,8 +1610,6 @@ class LocaleContentFunctionalTest extend
     );
     $this->drupalPost($path, $edit, t('Save'));
     $this->assertRaw(t('%title has been updated.', array('%title' => $node_title)), t('Basic page content updated.'));
-
-    $this->drupalLogout();
   }
 }
 
Index: modules/locale/tests/locale_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/tests/locale_test.module,v
retrieving revision 1.5
diff -u -p -r1.5 locale_test.module
--- modules/locale/tests/locale_test.module	4 Dec 2009 16:49:46 -0000	1.5
+++ modules/locale/tests/locale_test.module	9 Jul 2010 00:13:59 -0000
@@ -7,6 +7,18 @@
  */
 
 /**
+ * Implements hook_menu().
+ */
+function locale_test_menu() {
+  $items['locale-test'] = array(
+    'title' => 'Locale test page',
+    'page callback' => '_locale_test_page',
+    'access arguments' => array('access content'),
+  );
+  return $items;
+}
+
+/**
  * Implements hook_locale().
  */
 function locale_test_locale($op = 'groups') {
@@ -25,3 +37,13 @@ function locale_test_boot() {
     $_SERVER['HTTP_HOST'] = variable_get('locale_test_domain');
   }
 }
+
+function _locale_test_page() {
+  $items = array(
+    'items' => array(
+      format_plural(1, '1 locale test line', '@count locale test lines'),
+      format_plural(2, '1 locale test line', '@count locale test lines'),
+    ),
+  );
+  return theme('item_list', $items);
+}
