'Test that a range request for a partial file,
outputs partial content status code and valid Content-Range and Content-Length.
first_byte and last_byte are chosen to be simple but non trivial values.'

def test_range_request_partial_file(self):

    first_byte = (self.length_unlocked / 4)
    last_byte = (self.length_unlocked / 2)
    resp = self.client.get(self.url_unlocked, HTTP_RANGE='bytes={first}-{last}'.format(first=first_byte, last=last_byte))
    self.assertEqual(resp.status_code, 206)
    self.assertEqual(resp['Content-Range'], 'bytes    {first}-{last}/{length}'.format(first=first_byte, last=last_byte, length=self.length_unlocked))
    self.assertEqual(resp['Content-Length'], str(((last_byte - first_byte) + 1)))
