kennethreitz/tablib — pull request #81 by weirdcanada (2012-08-01 16:05:19+00:00)
Title: Frozen frame fix

# Preamble

This is my first pull request! Be gentle :)

# Overview

Fixed the Frozen Frame problem. Simply added a line to set the frozen column to be the column after the last column.

# We want to freeze the column after the last column
frzn_col_idx = get_column_letter(j + 2)
....
ws.freeze_panes = '%s%s' % (frzn_col_idx, row_number)

# Testing

Unfortunately, I wasn't able to figure out a good way to write an automated test. This is because `openpyxl`, to my knowledge, does not know which frames are frozen when opening a file. After you've set `freeze_frames`, you can check, but not before. Looking into `core.py`, I wasn't able to discern how, exactly, I could locate the local instance of the worksheet to test it directly (i.e. when you run `data.xlsx` there is a worksheet instance *somewhere*).

If you can find that, then you just want to write a test along the lines of:

self.assertEqual(self.founders.xlsx.(openpyxl_worksheet).freeze_panes, 'A4')