def test_ajax_download_response_returns_a_JSON_HttpResponse(self): #Setup excel = WriterExcelManager() rows = [] # Excersice result = excel.ajax_download_response(rows, '/tmp/', '') # Verify assertIsInstance(result, HttpResponse)
def test_ajax_download_response_returns_a_JSON_HttpResponse_with_dict( self): #Setup excel = WriterExcelManager() rows = [] # Excersice result = excel.ajax_download_response(rows, '/tmp/', '') # Verify excel_file = excel.get_for_download() self.assertEquals(result.content, '{"export_path": "file.xls"}')
def test_ajax_download_response_returns_a_JSON_HttpResponse_with_content_type( self): #Setup excel = WriterExcelManager() rows = [] # Excersice result = excel.ajax_download_response(rows, '/tmp/', '') # Verify content_disposition_expected = 'text/html; charset=utf-8' self.assertEquals(result['Content-Type'], content_disposition_expected)