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

        # Excersice
        result = excel.download_response(rows)

        # Verify
        assertIsInstance(result, HttpResponse)
    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_download_response_returns_a_HttpResponse_with_content_type(self):
        #Setup
        excel = WriterExcelManager()
        rows = []

        # Excersice
        result = excel.download_response(rows)

        # Verify
        content_disposition_expected = 'application/vnd.ms-excel'
        self.assertEquals(result['Content-Type'], content_disposition_expected)
    def test_download_response_returns_a_HttpResponse_with_content_dispoition(
            self):
        #Setup
        excel = WriterExcelManager()
        rows = []

        # Excersice
        result = excel.download_response(rows)

        # Verify
        content_disposition_expected = 'attachment; filename=file.xls'
        self.assertEquals(result['Content-Disposition'],
                          content_disposition_expected)