'Tests the `fid_range` keyword and the `step` keyword of .save().'

def test05_test_fid_range_step(self):

    def clear_counties():
        County.objects.all().delete()
    lm = LayerMapping(County, co_shp, co_mapping, transform=False, unique='name')
    clear_counties()
    bad_ranges = (5.0, 'foo', co_shp)
    for bad in bad_ranges:
        self.assertRaises(TypeError, lm.save, fid_range=bad)
    fr = (3, 5)
    self.assertRaises(LayerMapError, lm.save, fid_range=fr, step=10)
    lm.save(fid_range=fr)
    qs = County.objects.all()
    self.assertEqual(1, qs.count())
    self.assertEqual('Galveston', qs[0].name)
    clear_counties()
    lm.save(fid_range=slice(5, None), silent=True, strict=True)
    lm.save(fid_range=slice(None, 1), silent=True, strict=True)
    qs = County.objects.order_by('name')
    self.assertEqual(2, qs.count())
    (hi, co) = tuple(qs)
    (hi_idx, co_idx) = tuple(map(NAMES.index, ('Honolulu', 'Pueblo')))
    self.assertEqual('Pueblo', co.name)
    self.assertEqual(NUMS[co_idx], len(co.mpoly))
    self.assertEqual('Honolulu', hi.name)
    self.assertEqual(NUMS[hi_idx], len(hi.mpoly))
    for st in (4, 7, 1000):
        clear_counties()
        lm.save(step=st, strict=True)
        self.county_helper(county_feat=False)
