How do I post a node that has its created field set to the past in a test class?
When you access node create form using admin role created value is exposed using Authored Information...



So, You can able to set created date by creating user with administrator role for testing...

Please see implementation below..

&lt;?php


/**
 * Tests the functionality of the Simpletest example content type.
 */
class SimpletestExampleTestCase extends DrupalWebTestCase {
  protected $privileged_user;

  public static function getInfo() {
    // Note: getInfo() strings are not translated with t().
    return array(
        'name' =&gt; 'Simpletest Example',
        'description' =&gt; 'Ensure that the simpletest_example content type provided functions properly.',
        'group' =&gt; 'Examples',
    );
  }
  public function setUp() {
    // Enable any modules required for the test. This should be an array of
    // module names.
    parent::setUp(array('simpletest_example'));
    // Create and log in our privileged user.
    $user = $this-&gt;drupalCreateAdminUser();
    $this-&gt;drupalLogin($user);
  }



  public function drupalCreateAdminUser(array $permissions = array()) {
    $roles = user_roles();
    $index = array_search('administrator', $roles);
    $user = $this-&gt;drupalCreateUser($permissions);
    $user-&gt;roles[$index] = 'administrator';
    return user_save($user);
  }

  /**
   * Tests creation of a Simpletest example node.
   */
  public function testSimpleTestExampleCreate() {
    // Create node to edit.
    $edit = array();
    $edit['title'] = $this-&gt;randomName(8);
    $edit["body[und][0][value]"] = $this-&gt;randomName(16);
    $edit["date"] = "2012-04-19 22:54:38 +0530";
    $this-&gt;drupalPost('node/add/article', $edit, t('Save'));
    $this-&gt;assertText(t('Simpletest Example Node Type @title has been created.', array('@title' =&gt; $edit['title'])));
  }
}


Here is the output