'Upload the same file more than once'

def test_repeated_upload(self):

    thefile = os.path.join(gisdata.RASTER_DATA, 'test_grid.tif')
    uploaded1 = file_upload(thefile, overwrite=True)
    check_layer(uploaded1)
    uploaded2 = file_upload(thefile, overwrite=True)
    check_layer(uploaded2)
    uploaded3 = file_upload(thefile, overwrite=False)
    check_layer(uploaded3)
    msg = ('Expected    %s    but    got    %s' % (uploaded1.name, uploaded2.name))
    assert (uploaded1.name == uploaded2.name), msg
    msg = ('Expected    a    different    name    when    uploading    %s    using    overwrite=False    but    got    %s' % (thefile, uploaded3.name))
    assert (uploaded1.name != uploaded3.name), msg
    uploaded2.delete()
    uploaded3.delete()
