'Test uploading a layer with XML metadata'

def test_layer_upload_metadata(self):

    thelayer = os.path.join(gisdata.PROJECT_ROOT, 'both', 'good', 'sangis.org', 'Airport', 'Air_Runways.shp')
    self.assertTrue(('%s.xml' % thelayer), 'Expected    layer    XML    metadata    to    exist')
    uploaded = file_upload(thelayer, overwrite=True)
    self.assertEqual(uploaded.title, 'Air    Runways', 'Expected    specific    title    from    uploaded    layer    XML    metadata')
    self.assertEqual(uploaded.abstract, 'Airport    Runways', 'Expected    specific    abstract    from    uploaded    layer    XML    metadata')
    self.assertEqual(uploaded.purpose, 'To    show    the    location    of    Public    Airports    and    Runways    within    San    Diego    County', 'Expected    specific    purpose    from    uploaded    layer    XML    metadata')
    self.assertEqual(uploaded.supplemental_information, 'No    information    provided', 'Expected    specific    supplemental    information    from    uploaded    layer    XML    metadata')
    self.assertEqual(len(uploaded.keyword_list()), 5, 'Expected    specific    number    of    keywords    from    uploaded    layer    XML    metadata')
    self.assertEqual(uploaded.keyword_csv, u'Airport,Airports,Landing    Strips,Runway,Runways', 'Expected    CSV    of    keywords    from    uploaded    layer    XML    metadata')
    self.assertTrue(('Landing    Strips' in uploaded.keyword_list()), 'Expected    specific    keyword    from    uploaded    layer    XML    metadata')
    self.assertEqual(uploaded.constraints_other, 'None', 'Expected    specific    constraint    from    uploaded    layer    XML    metadata')
    self.assertEqual(uploaded.date, datetime.datetime(2010, 8, 3, 0, 0), 'Expected    specific    date    from    uploaded    layer    XML    metadata')
    uploaded.delete()
