'Test layer import management command'

def test_importlayer_mgmt_command(self):

    vector_file = os.path.join(gisdata.VECTOR_DATA, 'san_andres_y_providencia_administrative.shp')
    call_command('importlayers', vector_file, overwrite=True, keywords='test,    import,    san    andreas', title='Test    San    Andres    y    Providencia    Administrative', verbosity=1)
    lyr = Layer.objects.get(title='Test    San    Andres    y    Providencia    Administrative')
    self.assertIsNotNone(lyr)
    self.assertEqual(lyr.name, 'test_san_andres_y_providencia_administrative')
    self.assertEqual(lyr.title, 'Test    San    Andres    y    Providencia    Administrative')
    self.assertEqual(lyr.keyword_list(), [u'import', u'san    andreas', u'test'])
    lyr.delete()
