'Verify that create-postprocess does not overwrite
imported modified_on'

def testMtimeImport(self):

    s3db = current.s3db
    assertEqual = self.assertEqual
    mtime = datetime.datetime(1988, 8, 13, 10, 0, 0)
    xmlstr = ('\n<s3xml>\n                <resource    name="org_facility"    modified_on="%(mtime)s"    uuid="MTFAC">\n                                <data    field="name">MtimeTestOffice</data>\n                                <reference    field="organisation_id">\n                                                <resource    name="org_organisation"    modified_on="%(mtime)s"    uuid="MTORG">\n                                                                <data    field="name">MtimeTestOrg</data>\n                                                </resource>\n                                </reference>\n                </resource>\n</s3xml>' % {'mtime': mtime.isoformat()})
    from lxml import etree
    tree = etree.ElementTree(etree.fromstring(xmlstr))
    resource = s3db.resource('org_facility')
    result = resource.import_xml(tree)
    resource = s3db.resource('org_facility', uid='MTFAC')
    row = resource.select(['id', 'modified_on'], as_rows=True)[0]
    assertEqual(row.modified_on, mtime)
    resource = s3db.resource('org_organisation', uid='MTORG')
    row = resource.select(['id', 'modified_on'], as_rows=True)[0]
    assertEqual(row.modified_on, mtime)
