Exemplo n.º 1
0
    def test_add_one_with_new_until(self):
        """Add a Cultivar with New Until to worksheet.

        New Until values should be dates formatted MM/DD/YYYY because 'murica.
        """
        dt = datetime.date(2012, 12, 21)
        wb = Workbook()
        ws = wb.active
        cvws = CultivarsWorksheet(ws)
        cvws.setup()
        cv = Cultivar(name='Foxy')
        cv.common_name = CommonName(name='Foxglove')
        cv.common_name.index = Index(name='Perennial')
        cv.new_until = dt
        cvws.add_one(cv)
        assert cvws.cell(
            2, cvws.cols['New Until']
        ).value == dt.strftime('%m/%d/%Y')