

def test_get(self):
    response = self.client.get('/api/data/export/', HTTP_ACCEPT='application/json')
    self.assertEqual(response.status_code, codes.ok)
    self.assertEqual(response['Content-Type'], 'application/json')
    self.assertEqual(json.loads(response.content), {
        'title': 'Serrano Exporter Endpoints',
        'version': API_VERSION,
    })
    expected_links = '<http://testserver/api/data/export/sas/>; rel="sas"; description="Statistical Analysis System (SAS)"; title="SAS", <http://testserver/api/data/export/>; rel="self", <http://testserver/api/data/export/csv/>; rel="csv"; description="Comma-Separated Values (CSV)"; title="CSV", <http://testserver/api/data/export/r/>; rel="r"; description="R Programming Language"; title="R", <http://testserver/api/data/export/json/>; rel="json"; description="JavaScript Object Notation (JSON)"; title="JSON"'
    if OPTIONAL_DEPS['openpyxl']:
        expected_links += ', <http://testserver/api/data/export/excel/>; rel="excel"; description="Microsoft Excel 2007 Format"; title="Excel"'
    self.assertEqual(response['Link'], expected_links)

dataset/ETHPy150Open chop-dbhi/serrano/tests/cases/resources/tests/exporter.py ExporterResourceTestCase.test_get/original