'Verify that uploading time based shapefile works properly'

def test_time(self):

    cascading_delete(self.catalog, 'boxes_with_date')
    timedir = os.path.join(GOOD_DATA, 'time')
    layer_name = 'boxes_with_date'
    shp = os.path.join(timedir, ('%s.shp' % layer_name))
    (resp, data) = self.client.upload_file(shp)
    self.wait_for_progress(data.get('progress'))
    self.assertEquals(resp.code, 200)
    self.assertTrue(data['success'])
    self.assertTrue(data['redirect_to'], upload_step('time'))
    (resp, data) = self.client.get_html(upload_step('time'))
    self.assertEquals(resp.code, 200)
    data = dict(csrfmiddlewaretoken=self.client.get_csrf_token(), time_attribute='date', presentation_strategy='LIST')
    resp = self.client.make_request(upload_step('time'), data)
    url = json.loads(resp.read())['redirect_to']
    resp = self.client.make_request(url, data)
    url = json.loads(resp.read())['url']
    self.assertTrue(url.endswith(layer_name), ('expected    url    to    end    with    %s,    but    got    %s' % (layer_name, url)))
    self.assertEquals(resp.code, 200)
    url = urllib.unquote(url)
    self.check_layer_complete(url, layer_name)
    wms = get_wms(type_name=('geonode:%s' % layer_name))
    layer_info = wms.items()[0][1]
    self.assertEquals(100, len(layer_info.timepositions))
