def test_download_response_returns_a_HttpResponse_with_excel_file(self):
        #Setup
        excel = WriterExcelManager()
        rows = []

        # Excersice
        result = excel.download_response(rows)

        # Verify
        excel_file = excel.get_for_download()
        self.assertEquals(result.content, excel_file)
    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"}')